-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
|