|
1 | 1 | describe('Rolling Upgrades', () => { |
| 2 | + let DEV_VERSION = ''; |
| 3 | + |
| 4 | + before(() => { |
| 5 | + cy.request({ |
| 6 | + method: 'GET', |
| 7 | + url: 'http://localhost:51222/rest/v2/container', |
| 8 | + auth: { |
| 9 | + username: Cypress.env('username'), |
| 10 | + password: Cypress.env('password'), |
| 11 | + }, |
| 12 | + headers: { |
| 13 | + 'Content-Type': 'application/json', |
| 14 | + }, |
| 15 | + }).then((json) => { |
| 16 | + DEV_VERSION = json['version']; |
| 17 | + }); |
| 18 | + }); |
2 | 19 |
|
3 | 20 | it('successfully shows the rolling upgrades detection message in NYC', () => { |
4 | 21 | cy.origin('http://localhost:31222/console/', () => { |
5 | | - cy.visit("/", { |
| 22 | + cy.visit('/', { |
6 | 23 | headers: { |
7 | | - 'Accept-Encoding': 'gzip, deflate, br' |
| 24 | + 'Accept-Encoding': 'gzip, deflate, br', |
8 | 25 | }, |
9 | 26 | auth: { |
10 | 27 | username: Cypress.env('username'), |
11 | | - password: Cypress.env('password') |
12 | | - } |
| 28 | + password: Cypress.env('password'), |
| 29 | + }, |
13 | 30 | }); |
14 | 31 | cy.get('[data-cy=sideBarToggle]').click(); |
15 | | - cy.contains("NYC"); |
16 | | - cy.contains("Rolling Upgrade in Progress — Some features may be temporarily unavailable"); |
17 | | - }) |
| 32 | + cy.contains('NYC'); |
| 33 | + cy.contains( |
| 34 | + 'Rolling Upgrade in Progress — Some features may be temporarily unavailable', |
| 35 | + ); |
| 36 | + }); |
18 | 37 | }); |
19 | 38 |
|
20 | 39 | it('successfully shows the different server versions NYC, upgrades server and shows upgrade message', () => { |
21 | 40 | cy.origin('http://localhost:31222/console/', () => { |
22 | | - cy.visit("/cluster-membership", { |
| 41 | + cy.visit('/cluster-membership', { |
23 | 42 | headers: { |
24 | | - 'Accept-Encoding': 'gzip, deflate, br' |
| 43 | + 'Accept-Encoding': 'gzip, deflate, br', |
25 | 44 | }, |
26 | 45 | auth: { |
27 | 46 | username: Cypress.env('username'), |
28 | | - password: Cypress.env('password') |
29 | | - } |
| 47 | + password: Cypress.env('password'), |
| 48 | + }, |
30 | 49 | }); |
31 | 50 | cy.get('[data-cy=sideBarToggle]').click(); |
32 | | - cy.contains("2 members in use"); |
33 | | - cy.contains("Rolling Upgrade in Progress — Some features may be temporarily unavailable"); |
34 | | - cy.contains("16.0.0.Dev08"); |
35 | | - cy.contains("16.0.2-SNAPSHOT"); |
| 51 | + cy.contains( |
| 52 | + 'Rolling Upgrade in Progress — Some features may be temporarily unavailable', |
| 53 | + ); |
| 54 | + cy.contains('2 members in use'); |
| 55 | + cy.contains('16.0.0.Dev08'); |
| 56 | + cy.contains(DEV_VERSION); |
36 | 57 |
|
37 | 58 | // Restarting the docker container with same version and waiting for 20seconds to server to come up, reloading the page |
38 | | - cy.exec('bash restart_server_with_latest_version.sh > ~/log.log', 120000).then((result) => { |
39 | | - cy.log(result.stdout); |
40 | | - }); //waiting for script to finish max for 3 minutes |
41 | | - cy.wait(20000) |
| 59 | + cy.exec( |
| 60 | + 'bash restart_server_with_latest_version.sh > ~/log.log', |
| 61 | + 120000, |
| 62 | + ).then((result) => { |
| 63 | + cy.log(result.stdout); |
| 64 | + }); //waiting for script to finish max for 3 minutes |
| 65 | + cy.wait(20000); |
42 | 66 | cy.reload(); |
43 | 67 |
|
44 | 68 | cy.get('[data-cy=sideBarToggle]').click(); |
45 | | - cy.contains("2 members in use"); |
46 | | - cy.contains("Upgrade Complete — Please clear your browser cache and reconnect to see the latest console version."); |
47 | | - cy.contains("16.0.0.Dev08").should('not.exist'); |
48 | | - cy.contains("16.0.2-SNAPSHOT"); |
49 | | - }) |
| 69 | + cy.contains('2 members in use'); |
| 70 | + cy.contains( |
| 71 | + 'Upgrade Complete — Please clear your browser cache and reconnect to see the latest console version.', |
| 72 | + ); |
| 73 | + cy.contains('16.0.0.Dev08').should('not.exist'); |
| 74 | + cy.contains(DEV_VERSION); |
| 75 | + }); |
50 | 76 | }); |
51 | 77 |
|
52 | 78 | it('successfully refreshes the page and checks that upgrade done message is dissappeared', () => { |
53 | | - cy.origin('http://localhost:31222/console/', () => { |
54 | | - cy.visit("/", { |
55 | | - headers: { |
56 | | - 'Accept-Encoding': 'gzip, deflate, br' |
57 | | - }, |
58 | | - auth: { |
59 | | - username: Cypress.env('username'), |
60 | | - password: Cypress.env('password') |
61 | | - } |
62 | | - }); |
63 | | - cy.get('[data-cy=sideBarToggle]').click(); |
64 | | - cy.contains("Upgrade Complete — Please clear your browser cache and reconnect to see the latest console version.").should('not.exist'); |
65 | | - }) |
| 79 | + cy.origin('http://localhost:31222/console/', () => { |
| 80 | + cy.visit('/', { |
| 81 | + headers: { |
| 82 | + 'Accept-Encoding': 'gzip, deflate, br', |
| 83 | + }, |
| 84 | + auth: { |
| 85 | + username: Cypress.env('username'), |
| 86 | + password: Cypress.env('password'), |
| 87 | + }, |
| 88 | + }); |
| 89 | + cy.get('[data-cy=sideBarToggle]').click(); |
| 90 | + cy.contains( |
| 91 | + 'Upgrade Complete — Please clear your browser cache and reconnect to see the latest console version.', |
| 92 | + ).should('not.exist'); |
66 | 93 | }); |
| 94 | + }); |
67 | 95 | }); |
0 commit comments