Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
chiaryan committed Nov 12, 2024
1 parent 9663688 commit 3a975ff
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,43 @@ jobs:
cd ./apps/frontend
pnpm unit-test
test-webdriver-working:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.1.4

- name: Install dependencies
run: |
cd ./apps/frontend
pnpm i
- name: Install Chrome WebDriver
uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '130.0.6723.116'

- name: Install Edge
uses: browser-actions/setup-edge@v1
with:
edge-version: stable

- name: Install Geckodriver
uses: browser-actions/setup-geckodriver@latest


- name: Run Browser Test
run: |
cd ./apps/frontend
pnpm browser-test -- -t "webdriver installed correctly"
test-docker-compose:
runs-on: ubuntu-latest

Expand Down
5 changes: 4 additions & 1 deletion apps/frontend/__tests__/browser-tests/browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ const ETERNAL_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OD
const CHROME_OPTIONS = new ChromeOptions()
.addArguments("--headless=new") as ChromeOptions; // uncomment locally to see the steps in action
const EDGE_OPTIONS = new EdgeOptions()
.setBinaryPath("/opt/hostedtoolcache/msedge/stable/x64/msedge")
.addArguments("--headless=new") as EdgeOptions;

const FIREFOX_OPTIONS = new FirefoxOptions()
.setBinary("/opt/hostedtoolcache/geckodriver/0.35.0/x64/geckodriver")
.addArguments("--headless") as FirefoxOptions;

const builder = new Builder()
Expand All @@ -34,7 +37,7 @@ describe.each([Browser.CHROME, Browser.EDGE, Browser.FIREFOX])("%s driver test",
await driver.quit();
})

describe.skip("webdriver installed correctly", () => {
describe("webdriver installed correctly", () => {
it("does google search", async () => {
await driver.get('http://www.google.com');
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
Expand Down

0 comments on commit 3a975ff

Please sign in to comment.