Skip to content

Commit

Permalink
Merge branch 'next' into bugfix/FOUR-10752
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinbusso authored Feb 2, 2024
2 parents 4a78821 + 31cbe38 commit 5e8e340
Show file tree
Hide file tree
Showing 101 changed files with 11,324 additions and 9,090 deletions.
22 changes: 17 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ module.exports = {
eqeqeq: "error",
"max-len": ["error", { code: 140, ignoreUrls: true }],
"comma-dangle": ["error", "never"],
quotes: ["error", "double", { allowTemplateLiterals: true }],
quotes: [
"error",
"double",
{ avoidEscape: true, allowTemplateLiterals: true }
],
"import/no-extraneous-dependencies": "warn",
"consistent-return": "warn",
"no-plusplus": 0,
Expand All @@ -41,10 +45,18 @@ module.exports = {

overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)"
],
files: ["**/tests/**/*.{j,t}s?(x)", "**/tests/e2e/**/*.spec.{j,t}s?(x)"],
plugins: ["cypress"],
env: {
mocha: true,
"cypress/globals": true
},
rules: {
strict: "off"
}
},
{
files: ["**/tests/unit/**/*.spec.{j,t}s?(x)"],
env: {
jest: true
}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,26 @@ jobs:
# run: npm run test

- name: Cypress run
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
with:
browser: chrome
install: false
start: npm run dev -- --host
wait-on: http://localhost:5173/
config-file: cypress.json
start: npm run dev
wait-on: 'http://localhost:5173/'
config-file: cypress.config.js
spec: "tests/e2e/**/*"
record: true
parallel: true
group: 'CI - Chrome'
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# re-enable PR comment bot
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
- name: Upload Cypress Screenshots
uses: actions/upload-artifact@v3
# Only capture images on failure
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules
.nyc_output/
coverage/
tests/e2e/screenshots/
tests/e2e/videos/
tests/e2e/downloads

# local env files
.env.local
Expand Down
6 changes: 1 addition & 5 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@
}
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
"plugins": ["istanbul"]
}
60 changes: 60 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const { defineConfig } = require("cypress");
const { prepareAudit, lighthouse } = require("@cypress-audit/lighthouse");
const { pa11y } = require("@cypress-audit/pa11y");
const globby = require("globby");

module.exports = defineConfig({
projectId: "c4pb2f",
viewportWidth: 1140,
viewportHeight: 668,
video: false,
fixturesFolder: "tests/e2e/fixtures",
screenshotsFolder: "tests/e2e/screenshots",
videosFolder: "tests/e2e/videos",
downloadsFolder: "tests/e2e/downloads",
experimentalMemoryManagement: true,
numTestsKeptInMemory: 20,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
require("@cypress/code-coverage/task")(on, config);
// include any other plugin code...
on("before:browser:launch", (browser = {}, launchOptions) => {
prepareAudit(launchOptions);
});
on("task", {
lighthouse: lighthouse(),
pa11y: pa11y(),
// a task to find one file matching the given mask
// returns just the first matching file
async findFiles(mask) {
if (!mask) {
throw new Error("Missing a file mask to search");
}

console.log("searching for files %s", mask);
const list = await globby(mask);

if (!list.length) {
console.log("found no files");

return null;
}

console.log("found %d files, first one %s", list.length, list[0]);

return list[0];
}
});
// It's IMPORTANT to return the config object
// with any changed environment variables
return config;
},
testIsolation: false,
baseUrl: "http://localhost:5173",
specPattern: "tests/e2e/specs/**/*.{js,jsx,ts,tsx}",
supportFile: "tests/e2e/support/index.js",
waitForAnimations: true
}
});
8 changes: 0 additions & 8 deletions cypress.json

This file was deleted.

Loading

0 comments on commit 5e8e340

Please sign in to comment.