Added support for running E2E tests without seeded data (#14285)

This commit is contained in:
Nick Taylor 2021-07-22 08:45:37 -04:00 committed by GitHub
parent 09269ca972
commit 4858b75bb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 26 additions and 8 deletions

View file

@ -79,11 +79,17 @@ jobs:
- bin/test-console-check
- yarn build-storybook
- stage: Test
name: "E2E"
name: "E2E Seeded"
script:
- bundle exec rails db:create db:schema:load assets:precompile
- yarn cypress install
- bin/e2e-ci
- stage: Test
name: "E2E Non-seeded"
script:
- bundle exec rails db:create db:schema:load assets:precompile
- yarn cypress install
- SKIP_SEED_DATA=1 E2E_FOLDER=nonSeededFlows bin/e2e-ci
- stage: Deploy
name: Deploy DEV
if: type != pull_request

View file

@ -7,8 +7,11 @@ return unless Rails.env.test? && ENV["E2E"].present?
CypressRails.hooks.before_server_start do
# Called once, before either the transaction or the server is started
puts "Starting up server for end to end tests."
Rails.application.load_tasks
Rake::Task["db:seed:e2e"].invoke
if ENV["SKIP_SEED_DATA"].blank?
Rails.application.load_tasks
Rake::Task["db:seed:e2e"].invoke
end
end
CypressRails.hooks.after_transaction_start do
@ -22,7 +25,7 @@ end
CypressRails.hooks.before_server_stop do
# Called once, at_exit
puts "Cleaning up and stopping server for end to end tests."
Rake::Task["db:truncate_all"].invoke
Rake::Task["db:truncate_all"].invoke if ENV["SKIP_SEED_DATA"].blank?
puts "The end to end test server shutdown gracefully."
end

View file

@ -0,0 +1,5 @@
describe('Describe for the new E2E build node', () => {
it('Test for the new E2E build node', () => {
expect(true).to.be.true;
});
});

View file

@ -1,4 +1,4 @@
import { getInterceptsForLingeringUserRequests } from '../../util/networkUtils';
import { getInterceptsForLingeringUserRequests } from '../../../util/networkUtils';
describe('User Change Password', () => {
beforeEach(() => {

View file

@ -1,4 +1,4 @@
import { getInterceptsForLingeringUserRequests } from '../../util/networkUtils';
import { getInterceptsForLingeringUserRequests } from '../../../util/networkUtils';
describe('User Logout', () => {
beforeEach(() => {

View file

@ -1,4 +1,4 @@
import { BREAKPOINTS } from '../../../app/javascript/shared/components/useMediaQuery';
import { BREAKPOINTS } from '../../../../app/javascript/shared/components/useMediaQuery';
describe('Reading List Archive', () => {
beforeEach(() => {

View file

@ -1,4 +1,4 @@
import { BREAKPOINTS } from '../../../app/javascript/shared/components/useMediaQuery';
import { BREAKPOINTS } from '../../../../app/javascript/shared/components/useMediaQuery';
describe('Reading List Archive', () => {
beforeEach(() => {

View file

@ -25,6 +25,10 @@ module.exports = (on, config) => {
...process.env,
};
const { E2E_FOLDER = 'seededFlows' } = process.env;
config.testFiles = `**/${E2E_FOLDER}/**/*.spec.js`;
on('task', {
failed: require('cypress-failed-log/src/failed')(),
});