Skip to content

Commit

Permalink
ci/ui: add test for dhcp hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
juadk committed Feb 26, 2024
1 parent 0105924 commit 89304c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions tests/cypress/latest/e2e/unit_tests/machine_inventory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ describe('Machine inventory testing', () => {
const proxy = "http://172.17.0.1:3128"
const uiAccount = Cypress.env('ui_account');
const uiPassword = "rancherpassword"
let hostname = ""
// Test if machine inventory uses hostname given by DHCP
utils.isK8sVersion("k3s") && utils.isCypressTag("main") ? hostname=('node-001') : hostname=('my-machine');

beforeEach(() => {
(uiAccount == "user") ? cy.login(elementalUser, uiPassword) : cy.login();
Expand All @@ -50,15 +53,15 @@ describe('Machine inventory testing', () => {
.contains('Active')
.should('exist');
cy.getBySel('sortable-cell-0-1')
.contains('my-machine')
.contains(hostname)
.should('exist');
})
);

qase(29,
it('Check we can see our embedded hardware labels', () => {
cy.clickNavMenu(["Inventory of Machines"]);
cy.contains('my-machine')
cy.contains(hostname)
.click()
cy.checkMachInvLabel('machine-registration', 'myInvLabel1', 'myInvLabelValue1', true);
for (const key in hwLabels) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ config:
reset-oem: true
power-off: false
reboot: true
machineName: my-machine
machineName: ${System Data/Runtime/Hostname}

0 comments on commit 89304c5

Please sign in to comment.