diff --git a/Makefile.local b/Makefile.local --- a/Makefile.local +++ b/Makefile.local @@ -67,9 +67,22 @@ test-full: $(TEST) $(TESTFULL_FLAGS) $(TEST_DIRS) -test-frontend: build-webpack-test run-migrations-test - python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress run && pkill -P $$! && $(YARN) run mochawesome +.PHONY: test-frontend-cmd +test-frontend-cmd: build-webpack-test run-migrations-test + python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress run ; pkill -P $$! ; $(YARN) run mochawesome -test-frontend-ui: build-webpack-test run-migrations-test +test-frontend: export CYPRESS_SKIP_SLOW_TESTS=1 +test-frontend: test-frontend-cmd + +test-frontend-full: export CYPRESS_SKIP_SLOW_TESTS=0 +test-frontend-full: test-frontend-cmd + +.PHONY: test-frontend-ui-cmd +test-frontend-ui-cmd: build-webpack-test run-migrations-test bash -c "trap 'trap - SIGINT SIGTERM ERR EXIT; jobs -p | head -1 | xargs pkill -P' SIGINT SIGTERM ERR EXIT; python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress open" +test-frontend-ui: export CYPRESS_SKIP_SLOW_TESTS=1 +test-frontend-ui: test-frontend-ui-cmd + +test-frontend-full-ui: export CYPRESS_SKIP_SLOW_TESTS=0 +test-frontend-full-ui: test-frontend-ui-cmd diff --git a/cypress.json b/cypress.json --- a/cypress.json +++ b/cypress.json @@ -16,5 +16,8 @@ "html": false, "json": true } + }, + "env": { + "SKIP_SLOW_TESTS": 1 } } diff --git a/cypress/integration/content-rendering.spec.js b/cypress/integration/content-rendering.spec.js --- a/cypress/integration/content-rendering.spec.js +++ b/cypress/integration/content-rendering.spec.js @@ -5,9 +5,9 @@ * See top-level LICENSE file for more information */ -import {checkLanguageHighlighting} from '../utils'; +import {checkLanguageHighlighting, describeSlowTests} from '../utils'; -describe('Code highlighting tests', function() { +describeSlowTests('Code highlighting tests', function() { const extensions = require('../fixtures/source-file-extensions.json'); diff --git a/cypress/utils/index.js b/cypress/utils/index.js --- a/cypress/utils/index.js +++ b/cypress/utils/index.js @@ -50,3 +50,5 @@ const range = end - start; return Math.floor(Math.random() * range) + start; } + +export const describeSlowTests = Cypress.env('SKIP_SLOW_TESTS') === 1 ? describe.skip : describe;