Skip to content

Commit

Permalink
unpin chrome version
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonas Berhe authored and Yonas Berhe committed Dec 6, 2024
1 parent 13acc4b commit 24f9196
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 102 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ jobs:

# Installing fixed version of Chrome since latest version does not work (128 didn't work)
# Leaving this here again in case we need to pin to a specific Chrome version in the future
- name: Install Chrome 127
run: |
sudo apt-get install -y wget libu2f-udev
cd /tmp
wget -q http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.72-1_amd64.deb
sudo dpkg -i google-chrome-stable_127.0.6533.72-1_amd64.deb
sudo apt-get install -y --allow-downgrades ./google-chrome-stable_127.0.6533.72-1_amd64.deb
google-chrome --version
# - name: Install Chrome 127
# run: |
# sudo apt-get install -y wget libu2f-udev
# cd /tmp
# wget -q http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.72-1_amd64.deb
# sudo dpkg -i google-chrome-stable_127.0.6533.72-1_amd64.deb
# sudo apt-get install -y --allow-downgrades ./google-chrome-stable_127.0.6533.72-1_amd64.deb
# google-chrome --version

- name: Download e2e build
uses: actions/download-artifact@v4
Expand Down
190 changes: 96 additions & 94 deletions cypress/e2e/tests/pages/generic/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,100 +28,6 @@ describe('Home Page', () => {
cy.get('@settingsReq.all').should('have.length', 1);
});

describe('Home Page', { testIsolation: 'off' }, () => {
before(() => {
cy.login();
});

it('Can navigate to release notes page for latest Rancher version', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Verify changelog banner is hidden after clicking link
* Verify release notes link is valid github page
* Verify correct Rancher version is displayed
*/
HomePagePo.navTo();
homePage.waitForPage();
homePage.restoreAndWait();

cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
const rancherVersion = resp.body['value'].split('-', 1)[0].slice(1);

homePage.changelog().self().contains('Learn more about the improvements and new capabilities in this version.');
homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);

homePage.whatsNewBannerLink().invoke('attr', 'href').then((releaseNotesUrl) => {
cy.request(releaseNotesUrl).then((res) => {
expect(res.status).equals(200);
});
});

homePage.whatsNewBannerLink().click();
homePage.changelog().self().should('not.exist');
});
});

it('Can navigate to Preferences page', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Click link and verify user lands on preferences page
*/

HomePagePo.navTo();
homePage.waitForPage();
const prefPage = new PreferencesPagePo();

homePage.prefPageLink().click();
prefPage.waitForPage();
prefPage.checkIsCurrentPage();
prefPage.title();
});

it('Can restore hidden cards', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Hide home page banners
* Click the restore link
* Verify banners display on home page
*/
HomePagePo.navTo();
homePage.waitForPage();
homePage.restoreAndWait();

homePage.bannerGraphic().graphicBanner().should('be.visible');
homePage.bannerGraphic().graphicBannerCloseButton();
homePage.bannerGraphic().graphicBanner().should('not.exist');

homePage.getLoginPageBanner().checkVisible();
homePage.getLoginPageBanner().closeButton();
homePage.getLoginPageBanner().checkNotExists();

homePage.restoreAndWait();

homePage.bannerGraphic().graphicBanner().should('be.visible');
homePage.getLoginPageBanner().checkVisible();
});

it('Can use the Manage, Import Existing, and Create buttons', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Click 'Manage' button and verify user lands on the Cluster Management page
* Click on the Import Existing button and verify user lands on the cluster creation page in import mode
* Click on the Create button and verify user lands on the cluster creation page
*/
const clusterManagerPage = new ClusterManagerListPagePo('_');
const genericCreateClusterPage = new ClusterManagerImportGenericPagePo('_');

HomePagePo.navTo();
homePage.manageButton().click();
clusterManagerPage.waitForPage();

HomePagePo.goToAndWaitForGet();
homePage.importExistingButton().click();
genericCreateClusterPage.waitForPage('mode=import');

HomePagePo.goToAndWaitForGet();
homePage.createButton().click();
genericCreateClusterPage.waitForPage();
});
});

describe('List', { testIsolation: 'off' }, () => {
before(() => {
cy.login();
Expand Down Expand Up @@ -303,4 +209,100 @@ describe('Home Page', () => {
cy.url().should('include', '/support');
});
});

describe('Home Page', { testIsolation: 'off' }, () => {
before(() => {
cy.login();
});

// Note: This must be the last test to run in this test suite.
// When the test clicks on a link that opens a new tab it causes failures in tests that run after it.
it('Can navigate to Preferences page', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Click link and verify user lands on preferences page
*/

HomePagePo.navTo();
homePage.waitForPage();
const prefPage = new PreferencesPagePo();

homePage.prefPageLink().click();
prefPage.waitForPage();
prefPage.checkIsCurrentPage();
prefPage.title();
});

it('Can restore hidden cards', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Hide home page banners
* Click the restore link
* Verify banners display on home page
*/
HomePagePo.navTo();
homePage.waitForPage();
homePage.restoreAndWait();

homePage.bannerGraphic().graphicBanner().should('be.visible');
homePage.bannerGraphic().graphicBannerCloseButton();
homePage.bannerGraphic().graphicBanner().should('not.exist');

homePage.getLoginPageBanner().checkVisible();
homePage.getLoginPageBanner().closeButton();
homePage.getLoginPageBanner().checkNotExists();

homePage.restoreAndWait();

homePage.bannerGraphic().graphicBanner().should('be.visible');
homePage.getLoginPageBanner().checkVisible();
});

it('Can use the Manage, Import Existing, and Create buttons', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Click 'Manage' button and verify user lands on the Cluster Management page
* Click on the Import Existing button and verify user lands on the cluster creation page in import mode
* Click on the Create button and verify user lands on the cluster creation page
*/
const clusterManagerPage = new ClusterManagerListPagePo('_');
const genericCreateClusterPage = new ClusterManagerImportGenericPagePo('_');

HomePagePo.navTo();
homePage.manageButton().click();
clusterManagerPage.waitForPage();

HomePagePo.goToAndWaitForGet();
homePage.importExistingButton().click();
genericCreateClusterPage.waitForPage('mode=import');

HomePagePo.goToAndWaitForGet();
homePage.createButton().click();
genericCreateClusterPage.waitForPage();
});

it('Can navigate to release notes page for latest Rancher version', { tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
/**
* Verify changelog banner is hidden after clicking link
* Verify release notes link is valid github page
* Verify correct Rancher version is displayed
*/
HomePagePo.navTo();
homePage.waitForPage();
homePage.restoreAndWait();

cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
const rancherVersion = resp.body['value'].split('-', 1)[0].slice(1);

homePage.changelog().self().contains('Learn more about the improvements and new capabilities in this version.');
homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);

homePage.whatsNewBannerLink().invoke('attr', 'href').then((releaseNotesUrl) => {
cy.request(releaseNotesUrl).then((res) => {
expect(res.status).equals(200);
});
});

homePage.whatsNewBannerLink().click();
homePage.changelog().self().should('not.exist');
});
});
});
});

0 comments on commit 24f9196

Please sign in to comment.