mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Upgrade Cypress to 13.4.0 (#8271)
This commit is contained in:
@@ -4,6 +4,7 @@ module.exports = {
|
|||||||
'prettier',
|
'prettier',
|
||||||
'plugin:vue/recommended',
|
'plugin:vue/recommended',
|
||||||
'plugin:storybook/recommended',
|
'plugin:storybook/recommended',
|
||||||
|
'plugin:cypress/recommended',
|
||||||
],
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
parser: '@babel/eslint-parser',
|
parser: '@babel/eslint-parser',
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ GEM
|
|||||||
rexml
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
csv-safe (3.2.1)
|
csv-safe (3.2.1)
|
||||||
cypress-on-rails (1.13.1)
|
cypress-on-rails (1.16.0)
|
||||||
rack
|
rack
|
||||||
database_cleaner (2.0.2)
|
database_cleaner (2.0.2)
|
||||||
database_cleaner-active_record (>= 2, < 3)
|
database_cleaner-active_record (>= 2, < 3)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
backend: RAILS_ENV=test bin/rails s -p 5050
|
backend: RAILS_ENV=test bin/rails s -p 5050
|
||||||
frontend: bin/webpack-dev-server
|
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
|
||||||
worker: dotenv RAILS_ENV=test bundle exec sidekiq -C config/sidekiq.yml
|
worker: RAILS_ENV=test dotenv bundle exec sidekiq -C config/sidekiq.yml
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ export default {
|
|||||||
toStateName: 'labels_list',
|
toStateName: 'labels_list',
|
||||||
showModalForNewItem: true,
|
showModalForNewItem: true,
|
||||||
modalName: 'AddLabel',
|
modalName: 'AddLabel',
|
||||||
|
dataTestid: 'sidebar-new-label-button',
|
||||||
children: this.labels.map(label => ({
|
children: this.labels.map(label => ({
|
||||||
id: label.id,
|
id: label.id,
|
||||||
label: label.title,
|
label: label.title,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
variant="clear"
|
variant="clear"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
icon="add"
|
icon="add"
|
||||||
|
:data-testid="menuItem.dataTestid"
|
||||||
@click="e => newLinkClick(e, navigate)"
|
@click="e => newLinkClick(e, navigate)"
|
||||||
>
|
>
|
||||||
{{ $t(`SIDEBAR.${menuItem.newLinkTag}`) }}
|
{{ $t(`SIDEBAR.${menuItem.newLinkTag}`) }}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:required="required"
|
:required="required"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
:data-testid="dataTestid"
|
||||||
:value="value"
|
:value="value"
|
||||||
:class="{
|
:class="{
|
||||||
'focus:ring-red-600 ring-red-600': hasError,
|
'focus:ring-red-600 ring-red-600': hasError,
|
||||||
@@ -71,6 +72,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
dataTestid: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onInput(e) {
|
onInput(e) {
|
||||||
|
|||||||
@@ -85,6 +85,27 @@ test:
|
|||||||
# Compile test packs to a separate directory
|
# Compile test packs to a separate directory
|
||||||
public_output_path: packs-test
|
public_output_path: packs-test
|
||||||
|
|
||||||
|
dev_server:
|
||||||
|
https: false
|
||||||
|
host: 0.0.0.0
|
||||||
|
port: 3035
|
||||||
|
public: 0.0.0.0:3035
|
||||||
|
hmr: true
|
||||||
|
# Inline should be set to true if using HMR
|
||||||
|
inline: true
|
||||||
|
overlay: true
|
||||||
|
compress: true
|
||||||
|
disable_host_check: true
|
||||||
|
use_local_ip: false
|
||||||
|
quiet: false
|
||||||
|
headers:
|
||||||
|
'Access-Control-Allow-Origin': '*'
|
||||||
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS'
|
||||||
|
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
|
||||||
|
watch_options:
|
||||||
|
ignored: '**/node_modules/**'
|
||||||
|
|
||||||
|
|
||||||
production:
|
production:
|
||||||
<<: *default
|
<<: *default
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"test:coverage": "jest -w 1 --no-cache --collectCoverage",
|
"test:coverage": "jest -w 1 --no-cache --collectCoverage",
|
||||||
"webpacker-start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors",
|
"webpacker-start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors",
|
||||||
"start:dev": "foreman start -f ./Procfile.dev",
|
"start:dev": "foreman start -f ./Procfile.dev",
|
||||||
|
"start:test": "RAILS_ENV=test foreman start -f ./Procfile.test",
|
||||||
"start:dev-overmind": "overmind start -f ./Procfile.dev",
|
"start:dev-overmind": "overmind start -f ./Procfile.dev",
|
||||||
"storybook": "start-storybook -p 6006",
|
"storybook": "start-storybook -p 6006",
|
||||||
"build-storybook": "build-storybook",
|
"build-storybook": "build-storybook",
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
"opus-recorder": "^8.0.5",
|
"opus-recorder": "^8.0.5",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
"postcss-loader": "^4.2.0",
|
"postcss-loader": "^4.2.0",
|
||||||
"semver": "7.5.2",
|
"semver": "7.5.3",
|
||||||
"tailwindcss": "^3.3.2",
|
"tailwindcss": "^3.3.2",
|
||||||
"turbolinks": "^5.2.0",
|
"turbolinks": "^5.2.0",
|
||||||
"url-loader": "^2.0.0",
|
"url-loader": "^2.0.0",
|
||||||
@@ -120,12 +121,13 @@
|
|||||||
"babel-jest": "29",
|
"babel-jest": "29",
|
||||||
"babel-loader": "8.2.2",
|
"babel-loader": "8.2.2",
|
||||||
"babel-preset-vue": "^2.0.2",
|
"babel-preset-vue": "^2.0.2",
|
||||||
"cypress": "4.12.1",
|
"cypress": "^13.4.0",
|
||||||
"eslint": "^8.49.0",
|
"eslint": "^8.49.0",
|
||||||
"eslint-config-airbnb-base": "15.0.0",
|
"eslint-config-airbnb-base": "15.0.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-import-resolver-webpack": "^0.13.7",
|
"eslint-import-resolver-webpack": "^0.13.7",
|
||||||
"eslint-plugin-babel": "5.3.1",
|
"eslint-plugin-babel": "5.3.1",
|
||||||
|
"eslint-plugin-cypress": "^2.15.1",
|
||||||
"eslint-plugin-html": "7.1.0",
|
"eslint-plugin-html": "7.1.0",
|
||||||
"eslint-plugin-import": "2.28.1",
|
"eslint-plugin-import": "2.28.1",
|
||||||
"eslint-plugin-jsx-a11y": "6.7.1",
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
||||||
|
|||||||
10
spec/cypress.config.js
Normal file
10
spec/cypress.config.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const { defineConfig } = require('cypress');
|
||||||
|
|
||||||
|
module.exports = defineConfig({
|
||||||
|
defaultCommandTimeout: 10000,
|
||||||
|
viewportWidth: 1250,
|
||||||
|
viewportHeight: 800,
|
||||||
|
e2e: {
|
||||||
|
baseUrl: 'http://localhost:5050',
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"baseUrl": "http://localhost:5050",
|
|
||||||
"defaultCommandTimeout": 10000,
|
|
||||||
"viewportWidth": 1250,
|
|
||||||
"viewportHeight": 800
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
describe('AdminDashboardAuthentication', () => {
|
||||||
|
before(() => {
|
||||||
|
cy.app('clean');
|
||||||
|
cy.appScenario('default');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('authenticates an admin ', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
|
||||||
|
cy.get("[data-testid='email_input']").clear();
|
||||||
|
cy.get("[data-testid='email_input']").type('john@acme.inc');
|
||||||
|
cy.get("[data-testid='password_input']").clear();
|
||||||
|
cy.get("[data-testid='password_input']").type('Password1!');
|
||||||
|
|
||||||
|
cy.get("[data-testid='submit_button']").click();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
describe('AdminCreateLabel', () => {
|
||||||
|
before(() => {
|
||||||
|
cy.visit('/');
|
||||||
|
|
||||||
|
cy.get("[data-testid='email_input']").clear();
|
||||||
|
cy.get("[data-testid='email_input']").type('john@acme.inc');
|
||||||
|
cy.get("[data-testid='password_input']").clear();
|
||||||
|
cy.get("[data-testid='password_input']").type('Password1!');
|
||||||
|
|
||||||
|
cy.get("[data-testid='submit_button']").click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('open add label modal and create a label', () => {
|
||||||
|
cy.get("[data-testid='sidebar-new-label-button']").click();
|
||||||
|
|
||||||
|
cy.get("[data-testid='label-title'] > input").clear();
|
||||||
|
cy.get("[data-testid='label-title'] > input").type(
|
||||||
|
`show_stopper_${new Date().getTime()}`
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.get("[data-testid='label-description'] > input").clear();
|
||||||
|
cy.get("[data-testid='label-description'] > input").type(
|
||||||
|
'denote it with show show stopper cases'
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.get("[data-testid='label-submit']").click();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
describe('AdminDashboardAuthentication', function () {
|
|
||||||
before(() => {
|
|
||||||
cy.app('clean');
|
|
||||||
cy.appScenario('default');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('authenticates an admin ', function () {
|
|
||||||
cy.visit('/');
|
|
||||||
|
|
||||||
cy.get("[data-testid='email_input']")
|
|
||||||
.clear()
|
|
||||||
.type('john@acme.inc');
|
|
||||||
cy.get("[data-testid='password_input']")
|
|
||||||
.clear()
|
|
||||||
.type('Password1!');
|
|
||||||
|
|
||||||
cy.get("[data-testid='submit_button']").click();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
describe('AdminCreateLabel', () => {
|
|
||||||
before(() => {
|
|
||||||
cy.wait(3000);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('open add label modal', () => {
|
|
||||||
cy.get(
|
|
||||||
'ul.menu.vertical > li:last-child > a.sub-menu-title.side-menu > span.child-icon.ion-android-add-circle'
|
|
||||||
).click();
|
|
||||||
});
|
|
||||||
it('create a label', () => {
|
|
||||||
cy.get("[data-testid='label-title'] > input")
|
|
||||||
.clear()
|
|
||||||
.type(`show_stopper_${new Date().getTime()}`);
|
|
||||||
cy.get("[data-testid='label-description'] > input")
|
|
||||||
.clear()
|
|
||||||
.type('denote it with show show stopper cases');
|
|
||||||
|
|
||||||
cy.get("[data-testid='label-submit']").click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
/// <reference types="cypress" />
|
|
||||||
// ***********************************************************
|
|
||||||
// This example plugins/index.js can be used to load plugins
|
|
||||||
//
|
|
||||||
// You can change the location of this file or turn off loading
|
|
||||||
// the plugins file with the 'pluginsFile' configuration option.
|
|
||||||
//
|
|
||||||
// You can read more here:
|
|
||||||
// https://on.cypress.io/plugins-guide
|
|
||||||
// ***********************************************************
|
|
||||||
|
|
||||||
// This function is called when a project is opened or re-opened (e.g. due to
|
|
||||||
// the project's config changing)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {Cypress.PluginConfig}
|
|
||||||
*/
|
|
||||||
module.exports = (on, config) => {
|
|
||||||
// `on` is used to hook into various events Cypress emits
|
|
||||||
// `config` is the resolved Cypress config
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user