From 366cf5135b9e5375140eee291a6498ef304ca081 Mon Sep 17 00:00:00 2001 From: "Xenos F." Date: Fri, 8 Nov 2024 01:02:35 +0800 Subject: [PATCH] Prettify test --- test/HomePage.test.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/test/HomePage.test.js b/test/HomePage.test.js index a9fd8b04e0..fa649aae49 100644 --- a/test/HomePage.test.js +++ b/test/HomePage.test.js @@ -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); + }); }); -