Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/ui: Update QASE number and fix upgrade #1148

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 16 additions & 38 deletions tests/cypress/latest/e2e/unit_tests/elemental_operator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,36 @@ import filterTests from '~/support/filterTests.js';
import * as cypressLib from '@rancher-ecp-qa/cypress-library';
import { qase } from 'cypress-qase-reporter/dist/mocha';
import { isCypressTag, isRancherManagerVersion } from '~/support/utils';
import { Elemental } from '~/support/elemental';

filterTests(['main', 'upgrade'], () => {
Cypress.config();
describe('Install Elemental Operator', () => {
const elemental = new Elemental();

beforeEach(() => {
cy.login();
cy.visit('/');
cypressLib.burgerMenuToggle();
});

// Install the dev operator in the main scenario for Rancher >= 2.8.x
// Install the dev operator in the main scenario except for Rancher 2.7.x
if (isCypressTag('main') && !isRancherManagerVersion('2.7')){
qase(11,
it('Add local chartmuseum repo', () => {
cypressLib.addRepository('elemental-operator', Cypress.env('chartmuseum_repo')+':8080', 'helm', 'none');
})
);
it('Add local chartmuseum repo', () => {
cypressLib.addRepository('elemental-operator', Cypress.env('chartmuseum_repo')+':8080', 'helm', 'none');
})
};

if (!isRancherManagerVersion('2.7')) {
qase(13,
it('Install Elemental operator', () => {
cy.contains('local')
.click();
cy.get('.nav').contains('Apps')
.click();
if (isCypressTag('main')) {
cy.contains('.item.has-description.color1', 'Elemental', {timeout:30000})
.click();
} else {
cy.contains('Elemental', {timeout:30000})
.click();
}
cy.contains('Charts: Elemental', {timeout:30000});
cy.clickButton('Install');
cy.contains('.outer-container > .header', 'Elemental');
cy.clickButton('Next');
// Workaround for https://github.com/rancher/rancher/issues/43379
if (isCypressTag('upgrade')) {
cy.get('[data-testid="string-input-channel.repository"]')
.type('registry.suse.com/rancher/elemental-teal-channel')
cy.get('[data-testid="string-input-channel.tag"]')
.type('1.3.5')
}
cy.clickButton('Install');
cy.contains('SUCCESS: helm', {timeout:120000});
cy.reload;
cy.contains('Only User Namespaces') // eslint-disable-line cypress/unsafe-to-chain-command
.click()
.type('cattle-elemental-system{enter}{esc}');
cy.get('.outlet').contains('Deployed elemental-operator cattle-elemental-system', {timeout: 120000});
if (!isRancherManagerVersion('2.7') && isCypressTag('main')) {
qase(10,
it('Install latest stable Elemental operator', () => {
elemental.installElementalOperator();
})
);
} else if (!isRancherManagerVersion('2.7') && isCypressTag('upgrade')) {
qase(57,
it('Install latest dev Elemental operator', () => {
elemental.installElementalOperator();
})
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Elemental operator upgrade tests', () => {
cypressLib.addRepository('elemental-operator', Cypress.env('chartmuseum_repo')+':8080', 'helm', 'none');
});

qase(888,
qase(55,
it('Upgrade Elemental operator', () => {
cy.contains('local')
.click();
Expand All @@ -67,7 +67,7 @@ describe('Elemental operator upgrade tests', () => {
})
);

qase(889,
qase(58,
it('Check Elemental UI after upgrade', () => {
cy.viewport(1920, 1080);
// Elemental's icon should appear in the side menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('UI extension upgrade tests', () => {
cypressLib.addRepository('elemental-ui', 'https://github.com/rancher/elemental-ui.git', 'git', 'gh-pages');
});

qase(888,
qase(56,
it('Upgrade Elemental UI extension', () => {
cy.contains('Extensions')
.click();
Expand All @@ -58,7 +58,7 @@ describe('UI extension upgrade tests', () => {
cy.getBySel('extension-card-uninstall-btn-elemental')
})
);
qase(888,
qase(58,
it('Check Elemental UI after upgrade', () => {
cy.viewport(1920, 1080);
// Elemental's icon should appear in the side menu
Expand Down
13 changes: 10 additions & 3 deletions tests/cypress/latest/e2e/unit_tests/upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,16 @@ describe('Upgrade tests', () => {
cy.contains('Target Cluster')
cy.getBySel('cluster-target')
.click();
cy.get('#vs7__listbox')
.contains(clusterName)
.click();
// Next if condition will be removed once ui extension 1.3.0 is released
if (utils.isUIVersion('stable') || utils.isK8sVersion("rke2")) {
cy.get('#vs5__listbox')
.contains(clusterName)
.click();
} else {
cy.get('#vs7__listbox')
.contains(clusterName)
.click();
}
if (utils.isK8sVersion("k3s")) {
cy.getBySel('upgrade-choice-selector')
.parent()
Expand Down
14 changes: 12 additions & 2 deletions tests/cypress/latest/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ Cypress.Commands.add('createMachReg', (
// cy.getBySel('select-os-version-build-media')
// .click();
//}
cy.getBySel('select-os-version-build-media')
.click();
// Next if condition will be removed once ui extension 1.3.0 is released
if (utils.isUIVersion('stable')) {
cy.getBySel('select-os-version-build-iso')
.click();
} else {
cy.getBySel('select-os-version-build-media')
.click();
}
// Never build from dev ISO in upgrade scenario
if (utils.isCypressTag('upgrade')) {
// Stable operator version is hardcoded for now
Expand All @@ -128,10 +134,14 @@ Cypress.Commands.add('createMachReg', (
// In rare case, we might want to test upgrading from staging to dev
utils.isUpgradeOsChannel('dev') ? cy.contains('ISO x86_64 (unstable)').click(): null;
} else {
// We cannot use v2.0.2 because the latest stable operator is not in the marketplace yet
//cy.contains('ISO x86_64 v2.0.2')
cy.contains('ISO x86_64 v1.2.3')
.click();
}
} else if (utils.isOperatorVersion('registry.suse.com')) {
// We cannot use v2.0.2 because the latest stable operator is not in the marketplace yet
//cy.contains('ISO x86_64 v2.0.2')
cy.contains('ISO x86_64 v1.2.3')
.click();
} else {
Expand Down
33 changes: 33 additions & 0 deletions tests/cypress/latest/support/elemental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { isCypressTag } from '~/support/utils';
export class Elemental {
// Go into the cluster creation menu
accessClusterMenu() {
Expand Down Expand Up @@ -47,4 +48,36 @@ export class Elemental {
expect($lis.eq(6)).to.contain('Seed Images');
})
}

installElementalOperator() {
cy.contains('local')
.click();
cy.get('.nav').contains('Apps')
.click();
if (isCypressTag('main')) {
cy.contains('.item.has-description.color1', 'Elemental', {timeout:30000})
.click();
} else {
cy.contains('Elemental', {timeout:30000})
.click();
}
cy.contains('Charts: Elemental', {timeout:30000});
cy.clickButton('Install');
cy.contains('.outer-container > .header', 'Elemental');
cy.clickButton('Next');
// Workaround for https://github.com/rancher/rancher/issues/43379
if (isCypressTag('upgrade')) {
cy.get('[data-testid="string-input-channel.repository"]')
.type('registry.suse.com/rancher/elemental-teal-channel')
cy.get('[data-testid="string-input-channel.tag"]')
.type('1.3.5')
}
cy.clickButton('Install');
cy.contains('SUCCESS: helm', {timeout:120000});
cy.reload;
cy.contains('Only User Namespaces') // eslint-disable-line cypress/unsafe-to-chain-command
.click()
.type('cattle-elemental-system{enter}{esc}');
cy.get('.outlet').contains('Deployed elemental-operator cattle-elemental-system', {timeout: 120000});
}
}
Loading