-
Notifications
You must be signed in to change notification settings - Fork 24
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
Dimitri Kopriwa
committed
Nov 4, 2022
1 parent
d88ac06
commit d3aeac8
Showing
3 changed files
with
81 additions
and
0 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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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') | ||
}) | ||
}) |
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