Skip to content

Commit

Permalink
e2e: improve local setup
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-siemieniuk-morawska committed Jan 25, 2024
1 parent 818565a commit a4b1650
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 28 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,9 @@ If required, tests can run against `localhost:3000` by simply modifying `--host`

#### working with (visual) tests more efficiently

(TODO: improve DX)

You may not always need to run tests exactly like on the CI environment.

- To run specific suite, just change `test` script in `e2e/package.json` temporarily to `cypress run --spec cypress/integration/<spec.test.js>`
- To enable mounting `backend` code and live update, just use `e2e/docker-compose.cypress.dev.yml` instead.

## How to import records

Expand Down
3 changes: 2 additions & 1 deletion cypress-tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sh cypress-tests-setup.sh
sh cypress-tests-data.sh
sh cypress-tests-run.sh
sh cypress-tests-run-chrome.sh
sh cypress-tests-run-firefox.sh
4 changes: 1 addition & 3 deletions e2e/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = defineConfig({
videosFolder: 'cypress/__videos__',
screenshotsFolder: 'cypress/__screenshots__',
env: {
inspirehep_url: 'localhost:3000',
inspirehep_url: 'localhost:8080',
mobile_viewport_width: 375,
mobile_viewport_height: 667,
},
Expand All @@ -20,7 +20,5 @@ module.exports = defineConfig({
},
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
experimentalRunAllSpecs: true,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 0
},
})
5 changes: 0 additions & 5 deletions e2e/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ const {

module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name == 'chrome') {
launchOptions.args.push('--disable-gpu')
launchOptions.args.push('--disable-dev-shm-usage');
launchOptions.args.push('--js-flags="--max_old_space_size=8192 --max_semi_space_size=8192"');
}
return launchOptions
}),
addMatchImageSnapshotPlugin(on, config);
Expand Down
14 changes: 0 additions & 14 deletions e2e/docker-compose.cypress.dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2.1'

services:
cypress:
image: cypress/included:12.17.0
image: cypress/included:13
volumes:
- ./e2e:/tests
environment:
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test:dev": "cypress open",
"test": "cypress run",
"test": "cypress run --browser chrome",
"cypress": "cypress"
},
"author": "",
Expand Down

0 comments on commit a4b1650

Please sign in to comment.