Skip to content

Commit 0407f40

Browse files
committed
fix contain and other issues to remediate cypress run
1 parent 4084c8d commit 0407f40

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

cypress.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module.exports = defineConfig({
44
e2e: {
55
video: true,
66
experimentalStudio: true,
7+
viewportWidth: 1024,
8+
viewportHeight: 780,
79
env: {
810
HOTROD_NAMESPACE: 'hotrod',
911
SIGNADOT_ROUTING_KEY: '',

cypress/e2e/hotrod-e2e.cy.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ describe('hotrod e2e spec', () => {
99

1010
cy.get('.css-8g8ihq :nth-child(2) > :nth-child(2)').should('have.text', 'frontend');
1111
if (Cypress.env('SANDBOXED_FRONTEND') != "1") {
12-
cy.get(':nth-child(2) > :nth-child(3)').should('have.text', '(baseline)');
12+
cy.get(':nth-child(2) > :nth-child(3)').should('contain.text', '(baseline)');
1313
} else {
14-
cy.get(':nth-child(2) > :nth-child(3)').should('have.text', '(' + sandboxName + ')');
14+
cy.get(':nth-child(2) > :nth-child(3)').should('contain.text', '(' + sandboxName + ')');
1515
}
1616
cy.get('.css-8g8ihq :nth-child(3) > :nth-child(2)').should('have.text', 'location');
1717
if (Cypress.env('SANDBOXED_LOCATION') != "1") {
18-
cy.get(':nth-child(3) > :nth-child(3)').should('have.text', '(baseline)');
18+
cy.get(':nth-child(3) > :nth-child(3)').should('contain.text', '(baseline)');
1919
} else {
20-
cy.get(':nth-child(3) > :nth-child(3)').should('have.text', '(' + sandboxName + ')');
20+
cy.get(':nth-child(3) > :nth-child(3)').should('contain.text', '(' + sandboxName + ')');
2121
}
2222
cy.get(':nth-child(5) > :nth-child(2)').should('have.text', 'route');
2323
if (Cypress.env('SANDBOXED_ROUTE') != "1") {
24-
cy.get(':nth-child(5) > :nth-child(3)').should('have.text', '(baseline)');
24+
cy.get(':nth-child(5) > :nth-child(3)').should('contain.text', '(baseline)');
2525
} else {
26-
cy.get(':nth-child(5) > :nth-child(3)').should('have.text', '(' + sandboxName + ')');
26+
cy.get(':nth-child(5) > :nth-child(3)').should('contain.text', '(' + sandboxName + ')');
2727
}
2828
cy.get(':nth-child(6) > :nth-child(2)').should('have.text', 'driver');
2929
if (Cypress.env('SANDBOXED_DRIVER') != "1") {
30-
cy.get(':nth-child(6) > :nth-child(3)').should('have.text', '(baseline)');
30+
cy.get(':nth-child(6) > :nth-child(3)').should('contain.text', '(baseline)');
3131
} else {
32-
cy.get(':nth-child(6) > :nth-child(3)').should('have.text', '(' + sandboxName + ')');
32+
cy.get(':nth-child(6) > :nth-child(3)').should('contain.text', '(' + sandboxName + ')');
3333
}
3434
});
3535
})

cypress/support/commands.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ Cypress.Commands.add('requestRide', (from, to) => {
99
cy.visit(frontendURL);
1010
cy.get(':nth-child(1) > .chakra-select__wrapper > .chakra-select').select(from);
1111
cy.get(':nth-child(3) > .chakra-select__wrapper > .chakra-select').select(to);
12-
cy.get('.chakra-button').click();
12+
cy.contains('button', 'Request Ride').click();
13+
cy.contains('button', 'Show Logs').click();
1314
})

cypress/support/e2e.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@
1717
import './commands'
1818

1919
// Alternatively you can use CommonJS syntax:
20-
// require('./commands')
20+
// require('./commands')
21+
22+
Cypress.on('uncaught:exception', (err, runnable) => {
23+
// returning false here prevents Cypress from failing the test
24+
return false
25+
})

0 commit comments

Comments
 (0)