mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: cypress 10 (#47886)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -10,8 +10,6 @@ jobs:
|
||||
do-everything:
|
||||
name: Build
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:4
|
||||
@@ -57,7 +55,7 @@ jobs:
|
||||
run: cp client-config/serve.json client/public/serve.json
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v2
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
|
||||
start: npm run start-ci
|
||||
@@ -66,4 +64,4 @@ jobs:
|
||||
config: baseUrl=http://localhost:8000
|
||||
browser: chrome
|
||||
headless: true
|
||||
spec: cypress/integration/third-party/*.js
|
||||
spec: cypress/e2e/third-party/*.js
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
node-version: [16.x]
|
||||
include:
|
||||
- browsers: electron
|
||||
spec: cypress/integration/learn/challenges/projects.js
|
||||
spec: cypress/e2e/default/learn/challenges/projects.js
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:4
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
run: npm run seed
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v2
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
|
||||
start: npm run start-ci
|
||||
@@ -137,4 +137,4 @@ jobs:
|
||||
headless: true
|
||||
spec: |
|
||||
${{ matrix.spec }}
|
||||
cypress/integration/default/**/*.js
|
||||
cypress/e2e/default/**/*.js
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
const util = require('cypress/lib/util');
|
||||
const pkg = require('cypress/package.json');
|
||||
const execa = require('execa');
|
||||
|
||||
const pkg = util.pkgVersion();
|
||||
const version = pkg.version;
|
||||
|
||||
(async () => {
|
||||
console.log('Installing Cypress ' + pkg);
|
||||
console.log('Installing Cypress ' + version);
|
||||
await execa('npm', ['run', 'cypress:install'], {
|
||||
env: { CYPRESS_INSTALL_BINARY: pkg }
|
||||
env: { CYPRESS_INSTALL_BINARY: version }
|
||||
});
|
||||
console.log('Cypress installed');
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
const { execSync } = require('child_process');
|
||||
const { existsSync } = require('fs');
|
||||
const { defineConfig } = require('cypress');
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:8000',
|
||||
projectId: 'ke77ns',
|
||||
retries: 4,
|
||||
chromeWebSecurity: false,
|
||||
experimentalWebKitSupport: true,
|
||||
specPattern: 'cypress/e2e/default/**/*.js',
|
||||
setupNodeEvents(on, config) {
|
||||
config.env = config.env || {};
|
||||
on('before:run', () => {
|
||||
if (!existsSync('./config/curriculum.json')) {
|
||||
execSync('npm run build:curriculum');
|
||||
}
|
||||
});
|
||||
|
||||
config.env.API_LOCATION = 'http://localhost:3000';
|
||||
return config;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"projectId": "ke77ns",
|
||||
"baseUrl": "http://localhost:8000",
|
||||
"retries": 4,
|
||||
"chromeWebSecurity": false
|
||||
}
|
||||
Generated
+60
-13
@@ -72,7 +72,7 @@
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-plugin-transform-imports": "2.0.0",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "9.7.0",
|
||||
"cypress": "10.8.0",
|
||||
"cypress-plugin-stripe-elements": "1.0.2",
|
||||
"docsify-cli": "4.4.4",
|
||||
"eslint": "7.32.0",
|
||||
@@ -96,6 +96,7 @@
|
||||
"mock-fs": "5.1.4",
|
||||
"npm-run-all": "4.1.5",
|
||||
"ora": "5.4.1",
|
||||
"playwright-webkit": "^1.25.2",
|
||||
"prettier": "2.7.1",
|
||||
"prismjs": "1.29.0",
|
||||
"process": "0.11.10",
|
||||
@@ -21481,9 +21482,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cypress": {
|
||||
"version": "9.7.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-9.7.0.tgz",
|
||||
"integrity": "sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q==",
|
||||
"version": "10.8.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.8.0.tgz",
|
||||
"integrity": "sha512-QVse0dnLm018hgti2enKMVZR9qbIO488YGX06nH5j3Dg1isL38DwrBtyrax02CANU6y8F4EJUuyW6HJKw1jsFA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
@@ -21506,7 +21507,7 @@
|
||||
"dayjs": "^1.10.4",
|
||||
"debug": "^4.3.2",
|
||||
"enquirer": "^2.3.6",
|
||||
"eventemitter2": "^6.4.3",
|
||||
"eventemitter2": "6.4.7",
|
||||
"execa": "4.1.0",
|
||||
"executable": "^4.1.1",
|
||||
"extract-zip": "2.0.1",
|
||||
@@ -24622,9 +24623,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter2": {
|
||||
"version": "6.4.5",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"version": "6.4.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz",
|
||||
"integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
@@ -40906,6 +40908,34 @@
|
||||
"version": "1.3.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.25.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.25.2.tgz",
|
||||
"integrity": "sha512-0yTbUE9lIddkEpLHL3u8PoCL+pWiZtj5A/j3U7YoNjcmKKDGBnCrgHJMzwd2J5vy6l28q4ki3JIuz7McLHhl1A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-webkit": {
|
||||
"version": "1.25.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-webkit/-/playwright-webkit-1.25.2.tgz",
|
||||
"integrity": "sha512-MpSshLT2XhNpc8DrzKOE1HysO+v73wumY0KrkexQJ01UDqGWd+9oPc02Qz36IcqU8fyOqaGRNRoaacdpf1SmRA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"playwright-core": "1.25.2"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/pnp-webpack-plugin": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz",
|
||||
@@ -70271,9 +70301,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"cypress": {
|
||||
"version": "9.7.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-9.7.0.tgz",
|
||||
"integrity": "sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q==",
|
||||
"version": "10.8.0",
|
||||
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.8.0.tgz",
|
||||
"integrity": "sha512-QVse0dnLm018hgti2enKMVZR9qbIO488YGX06nH5j3Dg1isL38DwrBtyrax02CANU6y8F4EJUuyW6HJKw1jsFA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cypress/request": "^2.88.10",
|
||||
@@ -70295,7 +70325,7 @@
|
||||
"dayjs": "^1.10.4",
|
||||
"debug": "^4.3.2",
|
||||
"enquirer": "^2.3.6",
|
||||
"eventemitter2": "^6.4.3",
|
||||
"eventemitter2": "6.4.7",
|
||||
"execa": "4.1.0",
|
||||
"executable": "^4.1.1",
|
||||
"extract-zip": "2.0.1",
|
||||
@@ -72374,7 +72404,9 @@
|
||||
"version": "5.0.1"
|
||||
},
|
||||
"eventemitter2": {
|
||||
"version": "6.4.5",
|
||||
"version": "6.4.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz",
|
||||
"integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==",
|
||||
"dev": true
|
||||
},
|
||||
"eventemitter3": {
|
||||
@@ -83054,6 +83086,21 @@
|
||||
"platform": {
|
||||
"version": "1.3.6"
|
||||
},
|
||||
"playwright-core": {
|
||||
"version": "1.25.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.25.2.tgz",
|
||||
"integrity": "sha512-0yTbUE9lIddkEpLHL3u8PoCL+pWiZtj5A/j3U7YoNjcmKKDGBnCrgHJMzwd2J5vy6l28q4ki3JIuz7McLHhl1A==",
|
||||
"dev": true
|
||||
},
|
||||
"playwright-webkit": {
|
||||
"version": "1.25.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-webkit/-/playwright-webkit-1.25.2.tgz",
|
||||
"integrity": "sha512-MpSshLT2XhNpc8DrzKOE1HysO+v73wumY0KrkexQJ01UDqGWd+9oPc02Qz36IcqU8fyOqaGRNRoaacdpf1SmRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"playwright-core": "1.25.2"
|
||||
}
|
||||
},
|
||||
"pnp-webpack-plugin": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz",
|
||||
|
||||
+5
-4
@@ -55,12 +55,12 @@
|
||||
"create:utils": "tsc -p utils",
|
||||
"precypress": "node ./cypress-install.js",
|
||||
"cypress": "cypress",
|
||||
"cypress:dev:run": "npm run cypress -- run --spec cypress/integration/default/**/*.js",
|
||||
"cypress:dev:run": "npm run cypress -- run --spec cypress/e2e/default/**/*.js",
|
||||
"cypress:dev:watch": "npm run cypress -- open",
|
||||
"cypress:prd:run": "npm run cypress -- run --spec cypress/e2e/default/**/*.js",
|
||||
"cypress:prd:watch": "npm run cypress -- open",
|
||||
"cypress:install": "cypress install && echo 'for use with ./cypress-install.js'",
|
||||
"cypress:install-build-tools": "sh ./cypress-install.sh",
|
||||
"cypress:prd:run": "npm run cypress -- run --spec cypress/integration/default/**/*.js",
|
||||
"cypress:prd:watch": "npm run cypress -- open",
|
||||
"predevelop": "npm-run-all create:*",
|
||||
"develop": "npm-run-all build:curriculum -p develop:*",
|
||||
"develop:client": "npm run build:curriculum && cd ./client && npm run develop",
|
||||
@@ -152,7 +152,7 @@
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-plugin-transform-imports": "2.0.0",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "9.7.0",
|
||||
"cypress": "10.8.0",
|
||||
"cypress-plugin-stripe-elements": "1.0.2",
|
||||
"docsify-cli": "4.4.4",
|
||||
"eslint": "7.32.0",
|
||||
@@ -176,6 +176,7 @@
|
||||
"mock-fs": "5.1.4",
|
||||
"npm-run-all": "4.1.5",
|
||||
"ora": "5.4.1",
|
||||
"playwright-webkit": "^1.25.2",
|
||||
"prettier": "2.7.1",
|
||||
"prismjs": "1.29.0",
|
||||
"process": "0.11.10",
|
||||
|
||||
Reference in New Issue
Block a user