Added support for running E2E tests without seeded data (#14285)
This commit is contained in:
parent
09269ca972
commit
4858b75bb5
58 changed files with 26 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
5
cypress/integration/nonSeededFlows/test.spec.js
Normal file
5
cypress/integration/nonSeededFlows/test.spec.js
Normal 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;
|
||||
});
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { getInterceptsForLingeringUserRequests } from '../../util/networkUtils';
|
||||
import { getInterceptsForLingeringUserRequests } from '../../../util/networkUtils';
|
||||
|
||||
describe('User Change Password', () => {
|
||||
beforeEach(() => {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { getInterceptsForLingeringUserRequests } from '../../util/networkUtils';
|
||||
import { getInterceptsForLingeringUserRequests } from '../../../util/networkUtils';
|
||||
|
||||
describe('User Logout', () => {
|
||||
beforeEach(() => {
|
||||
|
|
@ -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(() => {
|
||||
|
|
@ -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(() => {
|
||||
|
|
@ -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')(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue