Skip to content

Commit

Permalink
desktop-firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Kopriwa committed Nov 4, 2022
1 parent d88ac06 commit d3aeac8
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/e2e-desktop-firefox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests e2e Desktop Safari

on:
workflow_dispatch:
inputs:
environment:
type: environment
description: Select the environment
required: true

jobs:
e2e-desktop-firefox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: yarn

- name: Setup sentry credentials
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
cat <<EOT >> ~/.sentryclirc
[defaults]
url=https://sentry.passculture.team/
org=sentry
project=application-native
[auth]
token=$SENTRY_AUTH_TOKEN
EOT
- name: Run Web on Desktop Chrome for ${{ inputs.environment }} environment
run: |
NODE_OPTIONS='--openssl-legacy-provider --max-old-space-size=4096' yarn start:web:${{ inputs.environment }} &>/dev/null &
- name: Waiting for server
run: |
until $(curl --output /dev/null --silent --head --fail http://localhost:3000); do
printf '.'
sleep 5
done
- uses: browser-actions/setup-geckodriver@latest
- run: geckodriver --version

- name: Run e2e Desktop Firefox tests
run: yarn test:e2e:desktop:firefox
26 changes: 26 additions & 0 deletions e2e/tests/pocs/createSession.desktop.firefox.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Builder, ThenableWebDriver } from 'selenium-webdriver'
import { Options } from 'selenium-webdriver/firefox'

describe('desktop firefox', () => {
let driver: ThenableWebDriver | undefined

beforeAll(async () => {
driver = new Builder().forBrowser('firefox')
.setFirefoxOptions(
new Options()
.headless()
)
.build()
expect(driver).toBeDefined()
})

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

it('should create session', async () => {
await driver.get('https://google.com')
const title = await driver.getTitle()
expect(title).toEqual('Google')
})
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"test:e2e:ios:native": "yarn test:e2e --testRegex ./e2e/tests/.*.ios.native.test.*",
"test:e2e:ios:safari": "yarn test:e2e --testRegex ./e2e/tests/.*.ios.safari.test.*",
"test:e2e:desktop:chrome": "yarn test:e2e --testRegex ./e2e/tests/.*.desktop.chrome.test.*",
"test:e2e:desktop:firefox": "yarn test:e2e --testRegex ./e2e/tests/.*.desktop.firefox.test.*",
"fix:lint": "eslint . --ext .js,.ts,.tsx,.mjs --fix",
"generate:api:client": "SWAGGER_CODEGEN_CLI_VERSION=3.0.30 ./scripts/generate_api_client.sh",
"ios:prod": "react-native run-ios --scheme PassCulture-Production",
Expand Down

0 comments on commit d3aeac8

Please sign in to comment.