{"size": 1590, "ext": "js", "max_stars_repo_path": "specs/TestsSpec.js", "max_stars_repo_name": "estuaryoss/estuary-viewer", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "specs/TestsSpec.js", "max_issues_repo_name": "estuaryoss/estuary-viewer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "specs/TestsSpec.js", "max_forks_repo_name": "estuaryoss/estuary-viewer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.4489795918, "max_line_length": 151, "alphanum_fraction": 0.7088050314}
let testsPage = require('../pages/Tests');

describe('Tests', function () {
  browser.waitForAngularEnabled(false); //not angular app

  it('it should have a title', async function () {
    await testsPage.goto();

    await expect(testsPage.getTitle()).toEqual('Estuary Viewer');
  });

  it('it should write dummy string in the searchbox and the filtered tests should be 0', async function () {
    let input = "dummy string";

    await testsPage.goto();
    await testsPage.sleep(2000);
    await expect(testsPage.getTotalTests()).toBeGreaterThan(0);

    await testsPage.sendKeysSearchInput(input);
    await expect(testsPage.getTotalTests()).toEqual(0);
  });

  it('it should write dummy string in the searchbox and the filtered tests should be greater then 0 after clear button is pressed', async function () {
    let input = "dummy string";

    await testsPage.goto();
    await testsPage.sleep(2000);
    await expect(testsPage.getTotalTests()).toBeGreaterThan(0);

    await testsPage.sendKeysSearchInput(input);
    await expect(testsPage.getTotalTests()).toEqual(0);

    await testsPage.clickOnClear();
    await expect(testsPage.getTotalTests()).toBeGreaterThan(0);
  });

  it('it should write a valid test Id in the searchbox and the filtered tests should be 1', async function () {
    await testsPage.goto();

    await testsPage.sleep(2000);
    let input = await testsPage.getTestId(0);
    await expect(testsPage.getTotalTests()).toBeGreaterThan(0);

    await testsPage.sendKeysSearchInput(input);
    await expect(testsPage.getTotalTests()).toEqual(1);
  });

});
