Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ install_build_dependency: &install_build_dependency
apt update
apt install jq -y
apt install python3-pip -y
apt install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y
pip3 install awscli --upgrade

install_dependency: &install_dependency
Expand All @@ -36,6 +37,7 @@ save_cache_settings: &save_cache_settings
key: connect-node-modules-{{ checksum "yarn.lock" }}
paths:
- node_modules
- /root/.cache/Cypress

running_yarn_tslint: &running_yarn_tslint
name: Running Yarn tslint
Expand All @@ -48,7 +50,9 @@ running_yarn_build: &running_yarn_build
command: |
source buildenvvar
yarn install
yarn cypress install
yarn build
yarn cy:ci

workspace_persist: &workspace_persist
root: .
Expand Down Expand Up @@ -79,6 +83,14 @@ build_steps: &build_steps
- run: *install_deploysuite
- run: *build_configuration_fetch
- run: *running_yarn_build
- store_test_results:
path: cypress/test-report
- store_artifacts:
path: cypress/test-report
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
- persist_to_workspace: *workspace_persist

deploy_steps: &deploy_steps
Expand Down Expand Up @@ -147,35 +159,6 @@ jobs:
APPNAME: "platform-ui-mvp"
steps: *deploy_steps

# Test job for the cases when we don not need deployment.
e2e-test:
docker:
- image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
steps:
- checkout
- restore_cache:
key: test-node-modules-{{ checksum "yarn.lock" }}
- run:
name: Config Git
command: git config --global url."https://git@".insteadOf git://
- run:
name: Install Dependencies
command: yarn install
no_output_timeout: 20m
- run:
name: Install Cypress Binary
command: yarn cypress install
- run:
name: Build the application
command: yarn build
no_output_timeout: 20m
- save_cache:
key: test-node-modules-{{ checksum "yarn.lock" }}
paths:
- node_modules
- /root/.cache/Cypress
- run: yarn cy:ci

workflows:
version: 2
build:
Expand All @@ -201,9 +184,6 @@ workflows:
ignore:
- master

- e2e-test:
context : org-global

- build-prod:
context : org-global
filters:
Expand All @@ -215,7 +195,6 @@ workflows:
context : org-global
requires:
- build-dev
- e2e-test
filters:
branches:
only:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# testing
/coverage
.nyc_output
/cypress/screenshots
/cypress/videos
/cypress/test-report

# production
/build
Expand Down
9 changes: 7 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { defineConfig } from 'cypress'

export default defineConfig({
fixturesFolder: false,
video: false,
screenshotOnRunFailure: false,
video: true,
screenshotOnRunFailure: true,
defaultCommandTimeout: 10000,
e2e: {
baseUrl: 'http://localhost:3000',
Expand All @@ -16,4 +16,9 @@ export default defineConfig({
return config;
},
},
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypress/test-report/test-result-[hash].xml',
toConsole: false
}
})
4 changes: 4 additions & 0 deletions cypress/e2e/home/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ describe('Landing Page', () => {
it('loads landing page should be successfully', () => {
cy.get('[data-id="root"]').should('be.visible')
})

it.skip('loads landing page should fail', () => {
cy.get('[data-id="root"]').should('not.be.visible')
})
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix",
"test": "react-scripts test --watchAll",
"test:no-watch": "react-scripts test --watchAll=false --passWithNoTests",
"cy:run": "cypress run",
"cy:run": "cypress run --reporter junit",
"cy:ci": "start-server-and-test 'serve -s build -n -p 3000' http://localhost:3000 'cy:run'",
"report:coverage": "nyc report --reporter=html",
"report:coverage:text": "nyc report --reporter=text"
Expand Down Expand Up @@ -94,6 +94,7 @@
"@types/segment-analytics": "^0.0.34",
"@types/systemjs": "^6.1.0",
"@types/uuid": "^8.3.4",
"@wdio/junit-reporter": "^7.24.0",
"autoprefixer": "^9.8.6",
"babel-eslint": "^11.0.0-beta.2",
"babel-jest": "^24.9.0",
Expand Down
Loading