We want to test the https://qa-codium-course.netlify.app application using cypress.
Install the dependencies if you don't want to use docker
npm install
Run the tests
npm run test
or using make
make test
make docker-build
make docker-tests
To run cucumber version
make docker-tests-cucumber
npm run unit
# or
make unit-test
npm run unit:coverage
# or
unit-coverage
Email: info@codium.team
Password: codiumTest
Credit Card Type | Credit Card Number |
---|---|
Visa | 4111111111111111 |
Please note this is just an example, actual user-agent may change for different devices based on browser and os version.
Device | User-Agent String |
---|---|
iPhone | Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1 |
Android | Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Mobile Safari/537.36 |
Desktop Computer | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36 |
Please follow the instructions for installation here:
https://github.com/uktrade/cypress-image-diff/blob/HEAD/docs/Cypress%20integration.md
Install modules
npm i -D @badeball/cypress-cucumber-preprocessor
npm i -D @bahmutov/cypress-esbuild-preprocessor
Then create a .cypress-cucumber-preprocessorrc.json
in the root directory with:
{
"stepDefinitions": [
"cypress/e2e/**/*.spec.ts"
]
}
And override cypress.config.ts
with:
import {defineConfig} from "cypress";
import getCompareSnapshotsPlugin from "cypress-image-diff-js/plugin";
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import { createEsbuildPlugin } from "@badeball/cypress-cucumber-preprocessor/esbuild";
export default defineConfig({
e2e: {
async setupNodeEvents(on, config) {
await addCucumberPreprocessorPlugin(on, config);
getCompareSnapshotsPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
return config;
},
specPattern: 'cypress/e2e/**/*.feature',
},
});