Skip to content

Commit 330bea5

Browse files
Merge pull request #1193 from cylc/renovate/cypress-12.x
chore(deps): update dependency cypress to v12
2 parents 9894d71 + 79742da commit 330bea5

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"circular-dependency-plugin": "^5.2.2",
7070
"concurrently": "^7.0.0",
7171
"cross-fetch": "^3.1.5",
72-
"cypress": "^10.10.0",
72+
"cypress": "^12.0.0",
7373
"eslint": "^8.0.0",
7474
"eslint-config-standard": "^17.0.0",
7575
"eslint-import-resolver-node": "^0.3.6",

tests/e2e/specs/drawer.cy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('Drawer component', () => {
2323
.should('be.visible')
2424
})
2525
it('it should have a width of 260', () => {
26+
cy.visit('/#/')
2627
cy.get('.v-navigation-drawer').invoke('innerWidth').should('be.eq', 260)
2728
})
2829
it('Is NOT displayed when mode is mobile', () => {

tests/e2e/specs/menu.cy.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ describe('CylcObject Menu component', () => {
1919
const collapsedWorkflowMenuLength = 6 // (5 mutations + "show more" btn)
2020
const expandedWorkflowMenuLength = 21
2121

22-
it('should not be displayed initially on load', () => {
22+
beforeEach(() => {
2323
cy.visit('/#/workspace/one')
24+
})
25+
26+
it('should not be displayed initially on load', () => {
2427
cy.get('.c-interactive:first') // wait for view to load
2528
.get('.c-mutation-menu:first')
2629
.should('not.exist')
@@ -38,24 +41,22 @@ describe('CylcObject Menu component', () => {
3841
.should('be.visible')
3942
})
4043

41-
it('expands when "show more" is clicked', () => {
42-
cy.get('#less-more-button')
44+
it('expands and collapses', () => {
45+
cy.get('#workflow-mutate-button.c-interactive')
46+
.click()
47+
.get('#less-more-button')
4348
.click()
4449
.get('.c-mutation-menu-list')
4550
.should('be.visible')
4651
.children()
4752
.should('have.length', expandedWorkflowMenuLength)
48-
})
49-
50-
it('closes when clicking outside of the menu', () => {
51-
// Click on hidden element to avoid clicking on anything unexpected
53+
// Should close when clicking outside of the menu
54+
// (click on hidden element to avoid clicking on anything unexpected)
5255
cy.get('noscript')
5356
.click({ force: true })
5457
.get('.c-mutation-menu-list:first')
5558
.should('not.be.visible')
56-
})
57-
58-
it('should be collapsed next time it is opened', () => {
59+
// Should be collapsed next time it is opened
5960
cy.get('#workflow-mutate-button')
6061
.click()
6162
.get('.c-mutation-menu-list')
@@ -66,8 +67,7 @@ describe('CylcObject Menu component', () => {
6667

6768
it('updates when clicking on a different Cylc object', () => {
6869
let firstID
69-
cy.visit('/#/workspace/one')
70-
.get('.node-data-cycle:first')
70+
cy.get('.node-data-cycle:first')
7171
.find('.c-interactive:first')
7272
.click()
7373
.get('.c-mutation-menu')
@@ -88,14 +88,15 @@ describe('CylcObject Menu component', () => {
8888
})
8989
})
9090

91-
it('should not close when clicking inside menu', () => {
91+
it('only closes when appropriate if clicking inside menu', () => {
92+
cy.get('#workflow-mutate-button.c-interactive')
93+
.click()
94+
// Should not close when clicking on non-interactive thing inside menu
9295
cy.get('.v-card__title')
9396
.click()
9497
.get('.c-mutation-menu')
9598
.should('be.visible')
96-
})
97-
98-
it('closes when clicking on task mutation', () => {
99+
// Should close when clicking on task mutation
99100
cy.get('.c-mutation-menu-list')
100101
.find('.c-mutation:not([aria-disabled]):first')
101102
.click()

tests/e2e/specs/workspace.cy.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616
*/
1717

1818
describe('Workspace view and component/widget', () => {
19+
beforeEach(() => {
20+
cy.visit('/#/workspace/one')
21+
})
22+
1923
afterEach(() => {
2024
cy
2125
.get('.v-alert')
2226
.should('not.exist')
2327
})
2428

2529
it('Should display the Lumino component in the Workspace view, with a Tree widget', () => {
26-
cy.visit('/#/workspace/one')
2730
cy.get('.lm-TabBar-tabLabel').should('have.length', 1)
2831

2932
// The skeleton loader should stop existing
@@ -40,22 +43,18 @@ describe('Workspace view and component/widget', () => {
4043
})
4144

4245
it('Should remove the default widget and leave no more widgets', () => {
43-
cy.visit('/#/workspace/one')
4446
cy.get('.lm-TabBar-tabCloseIcon').click()
4547
cy.get('.lm-TabBar-tabLabel').should('not.exist')
4648
})
4749

4850
it('Should be able to add two widgets of the same type', () => {
49-
cy.visit('/#/workspace/one')
5051
cy.get('.lm-TabBar-tabLabel').should('have.length', 1)
5152
cy.get('a.add-view').click()
5253
cy.get('#toolbar-add-Tree-view').click()
5354
cy.get('.lm-TabBar-tabLabel').should('have.length', 2)
5455
})
5556

5657
it('Should be able to add two widgets of different types', () => {
57-
cy.visit('/#/workspace/one')
58-
5958
// there should be one widget open by default (tree)
6059
cy.get('.lm-TabBar-tabLabel')
6160
// there should be a tab representing the widget
@@ -80,21 +79,21 @@ describe('Workspace view and component/widget', () => {
8079
})
8180

8281
it('Should remove widgets added successfully', () => {
83-
cy.visit('/#/workspace/one')
8482
cy.get('.lm-TabBar-tabLabel').should('have.length', 1)
8583
// add a tree view
8684
cy.get('a.add-view').click()
8785
cy.get('#toolbar-add-Tree-view').click()
8886
// ensure we have 2 widgets now
8987
cy.get('.lm-TabBar-tabLabel').should('have.length', 2)
9088
// close all widgets
91-
cy.get('.lm-TabBar-tabCloseIcon').click({ multiple: true })
89+
cy.get('.lm-TabBar-tabCloseIcon').each(($el) => {
90+
cy.wrap($el).click()
91+
})
9292
// ensure we have no widgets now
9393
cy.get('.lm-TabBar-tabLabel').should('not.exist')
9494
})
9595

9696
it('Should remove widgets when leaving the Workspace view', () => {
97-
cy.visit('/#/workspace/one')
9897
cy.get('.lm-TabBar-tabLabel').should('have.length', 1)
9998
// add a tree view
10099
cy.get('a.add-view').click()
@@ -107,7 +106,6 @@ describe('Workspace view and component/widget', () => {
107106
})
108107

109108
it('Should remove widgets when updating the Workspace view', () => {
110-
cy.visit('/#/workspace/one')
111109
cy.get('.lm-TabBar-tabLabel').should('have.length', 1)
112110
// add a tree view
113111
cy.get('a.add-view').click()

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6420,7 +6420,7 @@ __metadata:
64206420
concurrently: ^7.0.0
64216421
core-js: 3
64226422
cross-fetch: ^3.1.5
6423-
cypress: ^10.10.0
6423+
cypress: ^12.0.0
64246424
dedent: ^0.7.0
64256425
enumify: ^2.0.0
64266426
eslint: ^8.0.0
@@ -6470,9 +6470,9 @@ __metadata:
64706470
languageName: unknown
64716471
linkType: soft
64726472

6473-
"cypress@npm:^10.10.0":
6474-
version: 10.10.0
6475-
resolution: "cypress@npm:10.10.0"
6473+
"cypress@npm:^12.0.0":
6474+
version: 12.4.0
6475+
resolution: "cypress@npm:12.4.0"
64766476
dependencies:
64776477
"@cypress/request": ^2.88.10
64786478
"@cypress/xvfb": ^1.2.4
@@ -6518,7 +6518,7 @@ __metadata:
65186518
yauzl: ^2.10.0
65196519
bin:
65206520
cypress: bin/cypress
6521-
checksum: 668a32534a527dba79754abbf98af176b80c539a12ec00058932ba2a19c794c7888323e59e738c30f726ad740c5451c31d02548a0cb7c1b1c8ad01c55a984ca2
6521+
checksum: 34eeb48547e3bea3312e71147ddc87a08fe90cef92434194621a9bf7747026471b01e41f1ded3a406db4fbb2e70c03d7e5d0df011227f969882550fe64a7d5d1
65226522
languageName: node
65236523
linkType: hard
65246524

0 commit comments

Comments
 (0)