From 32be3e6afe78ac41d2907dfc8ae9eddeda512a3a Mon Sep 17 00:00:00 2001 From: Vitor Gomes Date: Wed, 10 Mar 2021 16:19:01 -0300 Subject: [PATCH 1/4] Move cypress code to the src path --- cypress.js | 18 +----------------- src/cypress.tsx | 20 ++++++++++++++++++++ {cypress => src/cypress}/plugins/index.js | 0 {cypress => src/cypress}/support/commands.ts | 0 {cypress => src/cypress}/support/index.js | 0 {cypress => src/cypress}/utils/assertion.ts | 0 {cypress => src/cypress}/utils/cart.ts | 0 {cypress => src/cypress}/utils/fill.ts | 0 {cypress => src/cypress}/utils/find.ts | 0 {cypress => src/cypress}/utils/index.ts | 0 {cypress => src/cypress}/utils/navigation.ts | 0 tsconfig.json | 2 +- 12 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 src/cypress.tsx rename {cypress => src/cypress}/plugins/index.js (100%) rename {cypress => src/cypress}/support/commands.ts (100%) rename {cypress => src/cypress}/support/index.js (100%) rename {cypress => src/cypress}/utils/assertion.ts (100%) rename {cypress => src/cypress}/utils/cart.ts (100%) rename {cypress => src/cypress}/utils/fill.ts (100%) rename {cypress => src/cypress}/utils/find.ts (100%) rename {cypress => src/cypress}/utils/index.ts (100%) rename {cypress => src/cypress}/utils/navigation.ts (100%) diff --git a/cypress.js b/cypress.js index 03fcac4..c2ff72e 100644 --- a/cypress.js +++ b/cypress.js @@ -1,17 +1 @@ -const utils = require('./dist/cypress/utils') -const vtexCommands = require('./dist/cypress/support/commands.js') - -module.exports = { - goToSearchPage: utils.goToSearchPage, - goToProductPageByShelf: utils.goToProductPageByShelf, - checkText: utils.checkText, - openCart: utils.openCart, - closeCart: utils.closeCart, - clearCart: utils.clearCart, - fillAndCheckShippingSimulator: utils.fillAndCheckShippingSimulator, - resolveIdentifier: utils.resolveIdentifier, - identifierExists: utils.identifierExists, - checkIfElementExists: utils.checkIfElementExists, - scrollToId: utils.scrollToId, - vtexCommands, -} +module.exports = require('./dist/cypress.js') diff --git a/src/cypress.tsx b/src/cypress.tsx new file mode 100644 index 0000000..b372653 --- /dev/null +++ b/src/cypress.tsx @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable @typescript-eslint/no-require-imports */ +import * as utils from './cypress/utils' + +const vtexCommands = require('./cypress/support/commands.js') + +module.exports = { + goToSearchPage: utils.goToSearchPage, + goToProductPageByShelf: utils.goToProductPageByShelf, + checkText: utils.checkText, + openCart: utils.openCart, + closeCart: utils.closeCart, + clearCart: utils.clearCart, + fillAndCheckShippingSimulator: utils.fillAndCheckShippingSimulator, + resolveIdentifier: utils.resolveIdentifier, + identifierExists: utils.identifierExists, + checkIfElementExists: utils.checkIfElementExists, + scrollToId: utils.scrollToId, + vtexCommands, +} diff --git a/cypress/plugins/index.js b/src/cypress/plugins/index.js similarity index 100% rename from cypress/plugins/index.js rename to src/cypress/plugins/index.js diff --git a/cypress/support/commands.ts b/src/cypress/support/commands.ts similarity index 100% rename from cypress/support/commands.ts rename to src/cypress/support/commands.ts diff --git a/cypress/support/index.js b/src/cypress/support/index.js similarity index 100% rename from cypress/support/index.js rename to src/cypress/support/index.js diff --git a/cypress/utils/assertion.ts b/src/cypress/utils/assertion.ts similarity index 100% rename from cypress/utils/assertion.ts rename to src/cypress/utils/assertion.ts diff --git a/cypress/utils/cart.ts b/src/cypress/utils/cart.ts similarity index 100% rename from cypress/utils/cart.ts rename to src/cypress/utils/cart.ts diff --git a/cypress/utils/fill.ts b/src/cypress/utils/fill.ts similarity index 100% rename from cypress/utils/fill.ts rename to src/cypress/utils/fill.ts diff --git a/cypress/utils/find.ts b/src/cypress/utils/find.ts similarity index 100% rename from cypress/utils/find.ts rename to src/cypress/utils/find.ts diff --git a/cypress/utils/index.ts b/src/cypress/utils/index.ts similarity index 100% rename from cypress/utils/index.ts rename to src/cypress/utils/index.ts diff --git a/cypress/utils/navigation.ts b/src/cypress/utils/navigation.ts similarity index 100% rename from cypress/utils/navigation.ts rename to src/cypress/utils/navigation.ts diff --git a/tsconfig.json b/tsconfig.json index 145e493..057be1e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,5 +9,5 @@ "allowJs": true, "types": ["cypress", "jest", "node"] }, - "include": ["./src/**/*", "./cypress/**/*"] + "include": ["./src/**/*"] } From 388fe64e8ce476c5810a76ef955e1dc09470d0f8 Mon Sep 17 00:00:00 2001 From: Vitor Gomes Date: Wed, 10 Mar 2021 16:20:53 -0300 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b103e..b120c1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Move cypress to the src path. + ### Added - Extensible commands, utils and generic tests for cypress/e2e. From 37202a93ddb451e5c50bad11565de6a015c083c7 Mon Sep 17 00:00:00 2001 From: Vitor Gomes Date: Wed, 10 Mar 2021 16:40:43 -0300 Subject: [PATCH 3/4] Change import syntax --- src/cypress.tsx | 7 ++----- src/cypress/support/commands.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cypress.tsx b/src/cypress.tsx index b372653..b8707e3 100644 --- a/src/cypress.tsx +++ b/src/cypress.tsx @@ -1,10 +1,7 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable @typescript-eslint/no-require-imports */ import * as utils from './cypress/utils' +import vtexCommands from './cypress/support/commands.js' -const vtexCommands = require('./cypress/support/commands.js') - -module.exports = { +export default { goToSearchPage: utils.goToSearchPage, goToProductPageByShelf: utils.goToProductPageByShelf, checkText: utils.checkText, diff --git a/src/cypress/support/commands.ts b/src/cypress/support/commands.ts index d238eb3..42be5be 100644 --- a/src/cypress/support/commands.ts +++ b/src/cypress/support/commands.ts @@ -70,4 +70,4 @@ const vtexCommands = () => { ) } -module.exports = vtexCommands +export default vtexCommands From de30588bf9d290dc142c5be39c093a8ae107712f Mon Sep 17 00:00:00 2001 From: Vitor Gomes Date: Wed, 10 Mar 2021 17:28:35 -0300 Subject: [PATCH 4/4] Release v3.4.1 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b120c1d..d2c29dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.4.1] - 2021-03-10 + ### Fixed - Move cypress to the src path. diff --git a/package.json b/package.json index d065994..a530c97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vtex/test-tools", - "version": "3.4.0", + "version": "3.4.1", "description": "VTEX IO testing tools", "repository": { "type": "git",