|
| 1 | +const enterCredentialsCognitoS3 = () => { |
| 2 | + var credentials = Cypress.env() |
| 3 | + cy.get('input[placeholder="XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab"]') |
| 4 | + .focus() |
| 5 | + .type(credentials.AWS_IDENTITY_POOL_ID) |
| 6 | + cy.get('input[placeholder="XX-XXXX-X"]') |
| 7 | + .first() |
| 8 | + .focus() |
| 9 | + .type(credentials.AWS_AUTH_REGION) |
| 10 | + cy.get('input[placeholder="XX-XXXX-X_12ab34cd9"]') |
| 11 | + .focus() |
| 12 | + .type(credentials.AWS_USER_POOL_ID) |
| 13 | + cy.get('input[placeholder="26-char alphanumeric string"]') |
| 14 | + .focus() |
| 15 | + .type(credentials.AWS_USER_POOL_WEB_CLIENT_ID) |
| 16 | + cy.get('input[placeholder="Name of the bucket"]') |
| 17 | + .focus() |
| 18 | + .type(credentials.AWS_STORAGE_BUCKET) |
| 19 | + cy.get('input[placeholder="XX-XXXX-X"]') |
| 20 | + .last() |
| 21 | + .focus() |
| 22 | + .type(credentials.AWS_STORAGE_REGION) |
| 23 | + cy.get('input[class="MuiInputBase-input MuiInput-input"]') |
| 24 | + .last() |
| 25 | + .focus() |
| 26 | + .type(credentials.COGNITO_USER_PASS_LENGTH) |
| 27 | + if (credentials.COGNITO_USER_PASS_REQUIRE_LOWERCASE == "TRUE") { |
| 28 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(0).click() |
| 29 | + } else { |
| 30 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(1).click() |
| 31 | + } |
| 32 | + if (credentials.COGNITO_USER_PASS_REQUIRE_UPPERCASE == "TRUE") { |
| 33 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(2).click() |
| 34 | + } else { |
| 35 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(3).click() |
| 36 | + } |
| 37 | + if (credentials.COGNITO_USER_PASS_REQUIRE_NUMBER == "TRUE") { |
| 38 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(4).click() |
| 39 | + } else { |
| 40 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(5).click() |
| 41 | + } |
| 42 | + if (credentials.COGNITO_USER_PASS_REQUIRE_SYMBOL == "TRUE") { |
| 43 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(6).click() |
| 44 | + } else { |
| 45 | + cy.get('input[class="PrivateSwitchBase-input-63"]').eq(7).click() |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +const test = () => { |
| 50 | + cy.log("should be able to set s3 config") |
| 51 | + cy.contains("Add Authentification").click() |
| 52 | + cy.contains("AWS - Cognito").click() |
| 53 | + enterCredentialsCognitoS3() |
| 54 | + cy.contains("Complete").click() |
| 55 | +} |
| 56 | + |
| 57 | +export default test |
0 commit comments