From f58f0351a0f83babfcc755ed4b4fc0909ed3cc09 Mon Sep 17 00:00:00 2001 From: Ryan Chia Date: Sun, 10 Nov 2024 21:13:59 +0800 Subject: [PATCH] asd --- .github/workflows/test.yml | 2 +- apps/frontend/__tests__/browser-tests/browser.test.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d8036ba25..7b0716889d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -262,7 +262,7 @@ jobs: - name: Install dependencies run: | cd ./apps/frontend - pnpm i -D + pnpm i - name: Install Chrome WebDriver uses: nanasess/setup-chromedriver@v2 diff --git a/apps/frontend/__tests__/browser-tests/browser.test.ts b/apps/frontend/__tests__/browser-tests/browser.test.ts index b715255fbd..97dcfe8e30 100644 --- a/apps/frontend/__tests__/browser-tests/browser.test.ts +++ b/apps/frontend/__tests__/browser-tests/browser.test.ts @@ -6,7 +6,7 @@ const ETERNAL_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OD describe("chrome browser", () => { const options = new Chrome.Options() - .addArguments("--headless=new") as Chrome.Options; // uncomment locally to see the steps in action + // .addArguments("--headless=new") as Chrome.Options; // uncomment locally to see the steps in action const builder = new Builder().forBrowser(Browser.CHROME).setChromeOptions(options); let driver: WebDriver; @@ -32,7 +32,7 @@ describe("chrome browser", () => { }); describe("browser-test", () => { - it.skip("accesses and login to peerprep", async () => { + it("accesses and login to peerprep", async () => { await driver.get(URL); await driver.wait(until.urlIs(`${URL}login`)); @@ -44,6 +44,11 @@ describe("chrome browser", () => { await submit.click(); await driver.wait(until.urlIs(`${URL}`)); + + const slogan1 = await driver.findElement(By.xpath("/html/body/div[1]/main/div/div[1]/div[2]/span[1]")).then(ele => ele.getText()) + const slogan2 = await driver.findElement(By.xpath("/html/body/div[1]/main/div/div[1]/div[2]/span[2]")).then(ele => ele.getText()) + + expect(slogan1 + slogan2).toBe("A better way to prepare for coding interviews withpeers"); }); }) })