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

[WIP] Cypress smoke suite #11518

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ module.exports = {
"jest/valid-expect": "off",
"jest/valid-expect-in-promise": "off",
"jest/no-done-callback": "off",
// covered by types, cypress plugins add extra options arguments
"jest/valid-describe-callback": "off",
},
},
],
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ jobs:
CYPRESS_PULL_REQUEST_ID: ${{ needs.prepare.outputs.pr_id }}
CYPRESS_PULL_REQUEST_URL: https://github.com/${{ github.repository }}/pull/${{ needs.prepare.outputs.pr_id }}

CYPRESS_grepTags: smoke

# pass the Percy token as an environment variable
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_ENABLE: ${{ needs.prepare.outputs.percy_enable }}
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/composer/composer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Composer", () => {
cy.createRoom({ name: "Composing Room" }).then((roomId) => cy.viewRoomById(roomId));
});

it("sends a message when you click send or press Enter", () => {
it("sends a message when you click send or press Enter", { tags: ["smoke"] }, () => {
// Type a message
cy.findByRole("textbox", { name: "Send a message…" }).type("my message 0");
// It has not been sent yet
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/create-room/create-room.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function openCreateRoomDialog(): Chainable<JQuery<HTMLElement>> {
return cy.get(".mx_CreateRoomDialog");
}

describe("Create Room", () => {
describe("Create Room", { tags: ["smoke"] }, () => {
let homeserver: HomeserverInstance;

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const verify = function (this: CryptoTestContext) {
});
};

describe("Cryptography", function () {
describe("Cryptography", { tags: ["smoke"] }, function () {
let aliceCredentials: UserCredentials;

beforeEach(function () {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/invite/invite-dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import type { MatrixClient } from "matrix-js-sdk/src/matrix";
import { HomeserverInstance } from "../../plugins/utils/homeserver";

describe("Invite dialog", function () {
describe("Invite dialog", { tags: ["smoke"] }, function () {
let homeserver: HomeserverInstance;
let bot: MatrixClient;
const botName = "BotAlice";
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/login/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import { doTokenRegistration } from "./utils";

describe("Login", () => {
describe("Login", { tags: ["smoke"] }, () => {
let homeserver: HomeserverInstance;

afterEach(() => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.

/// <reference types="cypress" />
import installLogsPrinter from "cypress-terminal-report/src/installLogsPrinter";
import registerCypressGrep from "@cypress/grep/src/plugin";

import PluginEvents = Cypress.PluginEvents;
import PluginConfigOptions = Cypress.PluginConfigOptions;
Expand All @@ -32,6 +33,7 @@ import { mailhogDocker } from "./mailhog";
* @type {Cypress.PluginConfig}
*/
export default function (on: PluginEvents, config: PluginConfigOptions) {
registerCypressGrep(config);
docker(on, config);
synapseDocker(on, config);
dendriteDocker(on, config);
Expand Down
2 changes: 1 addition & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "es2016",
"jsx": "react",
"lib": ["es2020", "dom", "dom.iterable"],
"types": ["cypress", "cypress-axe", "@percy/cypress", "@testing-library/cypress"],
"types": ["cypress", "cypress-axe", "@percy/cypress", "@testing-library/cypress", "@cypress/grep"],
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"@babel/register": "^7.12.10",
"@babel/traverse": "^7.12.12",
"@casualbot/jest-sonar-reporter": "^2.2.5",
"@cypress/grep": "^4.0.0",
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz",
"@peculiar/webcrypto": "^1.4.3",
"@percy/cli": "^1.11.0",
Expand Down
39 changes: 35 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55"
integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==

"@babel/parser@^7.21.2":
version "7.22.14"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.14.tgz#c7de58e8de106e88efca42ce17f0033209dfd245"
integrity sha512-1KucTHgOvaw/LzCVrEOAyXkr9rQlp0A1HiHRYnSUE9dmb8PvPW7o5sscg+5169r54n3vGlbx6GevTE/Iw/P3AQ==

"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e"
Expand Down Expand Up @@ -575,7 +580,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"

"@babel/plugin-syntax-jsx@^7.22.5":
"@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.22.5":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918"
integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==
Expand Down Expand Up @@ -1372,6 +1377,15 @@
resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz#798622546b63847e82389e473fd67f2707d82247"
integrity sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==

"@cypress/grep@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@cypress/grep/-/grep-4.0.0.tgz#d219259c62704d86651deceb0bd2d2e80ec5b559"
integrity sha512-5+X1P+GJmLp2IgX/OjoktJxFrezy4pYGI2wmi+574OTZ99yhNTesjKhMm0UJeEMAv9MjfihagroKbjdKNp/+og==
dependencies:
debug "^4.3.4"
find-test-names "^1.19.0"
globby "^11.0.4"

"@cypress/request@^2.88.11":
version "2.88.12"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590"
Expand Down Expand Up @@ -3105,7 +3119,7 @@ acorn-jsx@^5.3.2:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==

acorn-walk@^8.0.2, acorn-walk@^8.1.1:
acorn-walk@^8.0.2, acorn-walk@^8.1.1, acorn-walk@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
Expand Down Expand Up @@ -4342,7 +4356,7 @@ [email protected]:
dependencies:
ms "2.0.0"

debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
Expand Down Expand Up @@ -5460,6 +5474,18 @@ find-cache-dir@^2.0.0:
make-dir "^2.0.0"
pkg-dir "^3.0.0"

find-test-names@^1.19.0:
version "1.28.13"
resolved "https://registry.yarnpkg.com/find-test-names/-/find-test-names-1.28.13.tgz#871d5585d1f618ed772ffe544ea475ab4657ca83"
integrity sha512-hVatCLbiZmvBwqYNGTkVNbeJwK/8pvkXKQGji+23GzW8fVFHcEaRID77eQYItLKGwa1Tmu0AK2LjcUtuid57FQ==
dependencies:
"@babel/parser" "^7.21.2"
"@babel/plugin-syntax-jsx" "^7.18.6"
acorn-walk "^8.2.0"
debug "^4.3.3"
globby "^11.0.4"
simple-bin-help "^1.8.0"

find-up@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
Expand Down Expand Up @@ -5796,7 +5822,7 @@ globalthis@^1.0.3:
dependencies:
define-properties "^1.1.3"

globby@^11.1.0:
globby@^11.0.4, globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
Expand Down Expand Up @@ -9066,6 +9092,11 @@ signal-exit@^4.0.1:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967"
integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==

simple-bin-help@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/simple-bin-help/-/simple-bin-help-1.8.0.tgz#21bb82c6bccd9fa8678f9c0fadf2956b54e2160a"
integrity sha512-0LxHn+P1lF5r2WwVB/za3hLRIsYoLaNq1CXqjbrs3ZvLuvlWnRKrUjEWzV7umZL7hpQ7xULiQMV+0iXdRa5iFg==

sisteransi@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
Expand Down
Loading