Skip to content

Commit 282ceb3

Browse files
feat: upgrade to cypress 13 & fix expired coupon test
1 parent 28874d0 commit 282ceb3

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
"chai": "^4.2.0",
238238
"chai-as-promised": "^7.1.1",
239239
"cross-spawn": "^7.0.3",
240-
"cypress": "^11.2.0",
240+
"cypress": "^13.6.1",
241241
"eslint": "^8.49.0",
242242
"eslint-config-standard-with-typescript": "^39.0.0",
243243
"eslint-plugin-import": "^2.28.1",

test/cypress/e2e/basket.spec.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe('/#/basket', () => {
2525
})
2626
cy.visit('/#/order-summary')
2727

28-
// cy.get("mat-cell.mat-column-quantity > span").first().should("match",-100000)
2928
cy.get('mat-cell.mat-column-quantity > span')
3029
.first()
3130
.then(($ele) => {
@@ -77,13 +76,12 @@ describe('/#/basket', () => {
7776
cy.login({ email: 'jim', password: 'ncc-1701' })
7877
})
7978
describe('challenge "manipulateClock"', () => {
80-
it('should be possible to enter WMNSDY2019 coupon', () => {
79+
it('should be possible to enter WMNSDY2019 coupon & place order with this expired coupon', () => {
8180
cy.window().then(() => {
8281
window.localStorage.couponPanelExpanded = false
8382
})
8483
cy.visit('/#/payment/shop')
8584

86-
// yahan bt aa rahi in the console commands
8785
cy.window().then((win) => {
8886
cy.on('uncaught:exception', (_err, _runnable) => {
8987
// Introduced to disbale the uncaught:exception we get after the eval under this as TypeError: Date.now is not a function
@@ -97,10 +95,8 @@ describe('/#/basket', () => {
9795

9896
cy.get('#coupon').type('WMNSDY2019')
9997
cy.get('#applyCouponButton').click()
100-
})
101-
102-
it('should be possible to place an order with the expired coupon', () => {
103-
cy.visit('/#/order-summary')
98+
cy.get('.mat-radio-inner-circle').first().click()
99+
cy.get('.nextButton').click()
104100
cy.get('#checkoutButton').click()
105101
cy.expectChallengeSolved({ challenge: 'Expired Coupon' })
106102
})

0 commit comments

Comments
 (0)