Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Switch to sorry-cypress (#11668)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Sep 26, 2023
1 parent 54c88c5 commit 24b10a8
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,15 @@ jobs:
record: true
parallel: true
command-prefix: "yarn percy exec --parallel --"
command: "npx cypress-cloud run"
config: '{"reporter":"cypress-multi-reporters", "reporterOptions": { "configFile": "cypress-ci-reporter-config.json" } }'
ci-build-id: ${{ needs.prepare.outputs.uuid }}
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CURRENTS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CURRENTS_PROJECT_ID: ${{ github.repository }}
CURRENTS_API_URL: ${{ vars.CURRENTS_API_URL }}

# Use existing chromium rather than downloading another
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
Expand Down
4 changes: 3 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
import { defineConfig } from "cypress";
import * as fs from "node:fs";

import registerPlugins from "./cypress/plugins";

export default defineConfig({
video: true,
projectId: "ppvnzg",
Expand All @@ -38,7 +40,7 @@ export default defineConfig({
}
});

return require("./cypress/plugins/index.ts").default(on, config);
return registerPlugins(on, config);
},
baseUrl: "http://localhost:8080",
specPattern: "cypress/e2e/**/*.spec.{js,jsx,ts,tsx}",
Expand Down
25 changes: 17 additions & 8 deletions cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.

/// <reference types="cypress" />
import installLogsPrinter from "cypress-terminal-report/src/installLogsPrinter";
import cloudPlugin from "cypress-cloud/plugin";
import { initPlugins } from "cypress-plugin-init";

import PluginEvents = Cypress.PluginEvents;
import PluginConfigOptions = Cypress.PluginConfigOptions;
Expand All @@ -32,15 +34,22 @@ import { mailhogDocker } from "./mailhog";
* @type {Cypress.PluginConfig}
*/
export default function (on: PluginEvents, config: PluginConfigOptions) {
docker(on, config);
synapseDocker(on, config);
dendriteDocker(on, config);
slidingSyncProxyDocker(on, config);
webserver(on, config);
oAuthServer(on, config);
log(on, config);
initPlugins(
on,
[
cloudPlugin,
docker,
synapseDocker,
dendriteDocker,
slidingSyncProxyDocker,
webserver,
oAuthServer,
log,
mailhogDocker,
],
config,
);
installLogsPrinter(on, {
// printLogsToConsole: "always",
});
mailhogDocker(on, config);
}
1 change: 1 addition & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "@percy/cypress";
import "cypress-real-events";
import "@testing-library/cypress/add-commands";
import installLogsCollector from "cypress-terminal-report/src/installLogsCollector";
import "cypress-cloud/support";

import "./config.json";
import "./homeserver";
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@
"chokidar": "^3.5.1",
"cypress": "^13.0.0",
"cypress-axe": "^1.0.0",
"cypress-cloud": "^2.0.0-beta.0",
"cypress-multi-reporters": "^1.6.1",
"cypress-plugin-init": "^0.0.8",
"cypress-real-events": "^1.7.1",
"cypress-terminal-report": "^5.3.2",
"eslint": "8.48.0",
Expand Down
Loading

0 comments on commit 24b10a8

Please sign in to comment.