Skip to content

Commit f3cdd53

Browse files
xpath to ids
1 parent dd2d494 commit f3cdd53

File tree

5 files changed

+28
-56
lines changed

5 files changed

+28
-56
lines changed

cypress/integration/aws-test/export-aws.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import enterCredentialsCognitoS3 from "../utils/credentials-test/enter-credentials-cognito-s3"
2-
import enterCredentialsUser from "../utils/credentials-test/enter-credentials-user"
31
import commandSetLanguage from "../utils/cypress-command/set-language"
2+
import commandCredentialsAws from "../utils/cypress-command/credentials-aws"
43
import goToImportPage from "../utils/go-to-import-page"
54
import removeAWSFile from "../utils/remove-cypress-file-in-aws"
65

76
commandSetLanguage()
7+
commandCredentialsAws()
88

99
if (Cypress.env().AWS_IDENTITY_POOL_ID)
1010
describe("aws test", () => {
@@ -13,8 +13,7 @@ if (Cypress.env().AWS_IDENTITY_POOL_ID)
1313
cy.visit(`http://localhost:6001`)
1414
cy.wait(400)
1515
cy.setLanguage()
16-
enterCredentialsCognitoS3()
17-
enterCredentialsUser()
16+
cy.createCredentialsAws()
1817
goToImportPage()
1918
})
2019

cypress/integration/utils/credentials-test/enter-credentials-cognito-s3.js

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require("cypress-xpath")
21
const enterCredentialsCognitoS3 = () => {
32
cy.get('input[placeholder="XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab"]')
43
.focus()
@@ -25,64 +24,24 @@ const enterCredentialsCognitoS3 = () => {
2524
.focus()
2625
.type(Cypress.env().COGNITO_USER_PASS_LENGTH)
2726
if (Cypress.env().COGNITO_USER_PASS_REQUIRE_LOWERCASE === "TRUE") {
28-
cy.xpath(
29-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[8]/div[3]/div/button[1]/span[1]/span/span[1]/input"
30-
)
31-
.click()
32-
.focus()
33-
.blur()
27+
cy.get('input[id="RequireLowercaseYes"]').click().focus().blur()
3428
} else {
35-
cy.xpath(
36-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[8]/div[3]/div/button[2]/span[1]/span/span[1]/input"
37-
)
38-
.click()
39-
.focus()
40-
.blur()
29+
cy.get('input[id="RequireLowercaseNo"]').click().focus().blur()
4130
}
4231
if (Cypress.env().COGNITO_USER_PASS_REQUIRE_UPPERCASE === "TRUE") {
43-
cy.xpath(
44-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[9]/div[3]/div/button[1]/span[1]/span/span[1]/input"
45-
)
46-
.click()
47-
.focus()
48-
.blur()
32+
cy.get('input[id="RequireUppercaseYes"]').click().focus().blur()
4933
} else {
50-
cy.xpath(
51-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[9]/div[3]/div/button[2]/span[1]/span/span[1]/input"
52-
)
53-
.click()
54-
.focus()
55-
.blur()
34+
cy.get('input[id="RequireUppercaseNo"]').click().focus().blur()
5635
}
5736
if (Cypress.env().COGNITO_USER_PASS_REQUIRE_NUMBER === "TRUE") {
58-
cy.xpath(
59-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[10]/div[3]/div/button[1]/span[1]/span/span[1]/input"
60-
)
61-
.click()
62-
.focus()
63-
.blur()
37+
cy.get('input[id="RequireNumberYes"]').click().focus().blur()
6438
} else {
65-
cy.xpath(
66-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[10]/div[3]/div/button[2]/span[1]/span/span[1]/input"
67-
)
68-
.click()
69-
.focus()
70-
.blur()
39+
cy.get('input[id="RequireNumberNo"]').click().focus().blur()
7140
}
7241
if (Cypress.env().COGNITO_USER_PASS_REQUIRE_SYMBOL === "TRUE") {
73-
cy.xpath(
74-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[11]/div[3]/div/button[1]/span[1]/span/span[1]/input"
75-
)
76-
.click()
77-
.focus()
78-
.blur()
42+
cy.get('input[id="RequireSymbolYes"]').click().focus().blur()
7943
} else {
80-
cy.xpath(
81-
"./html/body/div[3]/div[3]/div/div[2]/div/div[2]/div[11]/div[3]/div/button[2]/span[1]/span/span[1]/input"
82-
)
83-
.click()
84-
.focus()
85-
.blur()
44+
cy.get('input[id="RequireSymbolNo"]').click().focus().blur()
8645
}
8746
}
8847

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@
6969
"cypress-image-snapshot": "^3.1.1",
7070
"cypress-terminal-report": "^2.4.0",
7171
"electron": "^11.2.3",
72-
"cypress-xpath": "^1.6.1",
7372
"electron-builder": "^22.8.0",
7473
"electron-builder-notarize": "^1.2.0",
7574
"eslint-plugin-cypress": "^2.11.2",
7675
"gh-pages": "^2.1.1",
77-
"material-survey": "^1.0.40",
7876
"parcel": "^1.12.4",
7977
"prettier": "^2.2.1",
8078
"react": "^16.8.6",
@@ -110,6 +108,7 @@
110108
"jac-format": "^1.1.3",
111109
"js-md5": "^0.7.3",
112110
"mime-types": "^2.1.28",
111+
"material-survey": "^1.0.41",
113112
"moment": "^2.24.0",
114113
"nan": "^2.14.1",
115114
"posthog-js": "^1.0.4",

src/components/AddAuthFromTemplateDialog/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,28 @@ const forms = {
104104
title: "Require a lowercase letter in password",
105105
type: "boolean",
106106
isRequired: true,
107+
id: "RequireLowercase",
107108
},
108109
{
109110
name: "auth.cognito.password.requireUppercase",
110111
title: "Require a uppercase letter in password",
111112
type: "boolean",
112113
isRequired: true,
114+
id: "RequireUppercase",
113115
},
114116
{
115117
name: "auth.cognito.password.requireNumbers",
116118
title: "Require a number in password",
117119
type: "boolean",
118120
isRequired: true,
121+
id: "RequireNumber",
119122
},
120123
{
121124
name: "auth.cognito.password.requireSymbols",
122125
title: "Require a symbol in password",
123126
type: "boolean",
124127
isRequired: true,
128+
id: "RequireSymbol",
125129
},
126130
],
127131
},

yarn.lock

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14240,7 +14240,7 @@ matcher@^3.0.0:
1424014240
dependencies:
1424114241
escape-string-regexp "^4.0.0"
1424214242

14243-
material-survey@^1.0.34, material-survey@^1.0.40:
14243+
material-survey@^1.0.34:
1424414244
version "1.0.40"
1424514245
resolved "https://registry.yarnpkg.com/material-survey/-/material-survey-1.0.40.tgz#35c650826fe94d69a6c40e08a120abb51a40d03c"
1424614246
integrity sha512-im5elNvoetmsRaafw/92YAyBXalQKXAjBwJDnJiwV23z6GBZ4dcjdMrUkIGXxZRsFrdy2/yrap0haB6mfNUzSg==
@@ -14251,6 +14251,17 @@ material-survey@^1.0.34, material-survey@^1.0.40:
1425114251
react-select "^3.0.8"
1425214252
surveyjs-expression-eval "^1.0.2"
1425314253

14254+
material-survey@^1.0.41:
14255+
version "1.0.41"
14256+
resolved "https://registry.yarnpkg.com/material-survey/-/material-survey-1.0.41.tgz#6e9db6601aa991bda1175ea2e47b3692be925bd9"
14257+
integrity sha512-WlfMw2twMpZ9THevzPMaDsiTMrzA2SRK8ferhobRL1XHqwtG9MlMHpLzRxe2df54vJUMTk98JFASOO3sTNkCmg==
14258+
dependencies:
14259+
k-choice-sort "^1.0.9"
14260+
lodash "^4.17.11"
14261+
react-dropzone "^8.0.1"
14262+
react-select "^3.0.8"
14263+
surveyjs-expression-eval "^1.0.2"
14264+
1425414265
md5-hex@^3.0.1:
1425514266
version "3.0.1"
1425614267
resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c"

0 commit comments

Comments
 (0)