Skip to content

Commit

Permalink
Prettify test
Browse files Browse the repository at this point in the history
  • Loading branch information
xenosf committed Nov 7, 2024
1 parent e34c69c commit 366cf51
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions test/HomePage.test.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
let {getWebDriver, ROOT_URL} = require("./utils");
const {By} = require('selenium-webdriver')
let { getWebDriver, ROOT_URL } = require("./utils");
const { By } = require("selenium-webdriver");

let driver;
let url = ROOT_URL;
let url = ROOT_URL;

beforeAll(async () => {
/**
* Trivial test case. Mostly used to debug system testing.
*/
describe("homepage contains 'PeerPrep' clickable link in toolbar", () => {
beforeAll(async () => {
driver = await getWebDriver();
}, 20 * 1000);
});

beforeEach(async () => {
beforeEach(async () => {
await driver.get(url);
});
afterAll(async () => {
});

afterAll(async () => {
if (driver) await driver.quit();
});
});

test('clicking "PeerPrep" text in toolbar navigates to homepage', async () => {
let link = await driver.findElement(By.linkText("PeerPrep"));
test('clicking "PeerPrep" text in toolbar navigates to homepage', async () => {
let link = await driver.findElement(By.linkText("PeerPrep"));
await link.click();
let newUrl = await driver.getCurrentUrl();
expect(newUrl).toMatch(url);
});
});

0 comments on commit 366cf51

Please sign in to comment.