Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Increased default timeouts for testing on slow VMs (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibragins committed Jun 1, 2022
1 parent 38b1f66 commit 70e3063
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pkg/qe-tests/cypress/integration/models/mapping.ts
Expand Up @@ -105,7 +105,7 @@ export class Mapping {

protected validateReady(mappingData: MappingData): void {
const { name } = mappingData;
cy.contains(name)
cy.contains(name, { timeout: 120 * SEC })
.parent(trTag)
.within(() => {
cy.get(dataLabel.status, { timeout: 600 * SEC }).should('contain.text', 'OK');
Expand Down
6 changes: 3 additions & 3 deletions pkg/qe-tests/cypress/integration/models/plan.ts
Expand Up @@ -108,7 +108,7 @@ export class Plan {
//To select Openshift Virtualization Migration network in plan wizard
cy.wait(2 * SEC);
clickByText(button, differentNetwork);
cy.get(network).should('contain.text', ocpMigrationNetwork);
cy.get(network, { timeout: 120 * SEC }).should('contain.text', ocpMigrationNetwork);
selectFromDroplist(network, podNetwork);
confirm();
}
Expand All @@ -125,7 +125,7 @@ export class Plan {
} else if (providerData.type == providerType.rhv) {
cluster = sourceClusterName;
}
cy.contains('label', cluster, { timeout: 60 * SEC })
cy.contains('label', cluster, { timeout: 120 * SEC })
.closest('.pf-c-tree-view__node-container')
.within(() => {
click(button);
Expand All @@ -141,7 +141,7 @@ export class Plan {
vmList.forEach((name) => {
inputText(searchInput, name);
click(selector);
cy.get(tdTag)
cy.get(tdTag, { timeout: 120 * SEC })
.contains(name)
.closest(trTag)
.within(() => {
Expand Down
16 changes: 8 additions & 8 deletions pkg/qe-tests/cypress/integration/models/providerVmware.ts
Expand Up @@ -75,7 +75,7 @@ export class ProviderVmware extends Provider {
protected selectHostEsxi(providerData: VmwareProviderData): void {
const { hostnames } = providerData.esxiHostList;
hostnames.forEach((name) => {
cy.get(tdTag)
cy.get(tdTag, { timeout: 120 * SEC })
.contains(name)
.closest(trTag)
.within(() => {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class ProviderVmware extends Provider {
protected populate(providerData: VmwareProviderData): void {
ProviderVmware.openList();
const { name, hostname } = providerData;
cy.contains(name)
cy.contains(name, { timeout: 120 * SEC })
.parent(trTag)
.within(() => {
// Validating that provider is in `Ready` state
Expand All @@ -119,26 +119,26 @@ export class ProviderVmware extends Provider {
} else {
cy.get(dataLabel.status, { timeout: 600 * SEC }).should('have.text', 'Ready');
// Validating that endpoint is in proper format and contains proper URL
cy.get(dataLabel.endpoint, { timeout: 30 * SEC }).should(
cy.get(dataLabel.endpoint, { timeout: 120 * SEC }).should(
'contain.text',
`https://${hostname}/sdk`
);
// Validating that amount of clusters is not empty and is not 0
cy.get(dataLabel.clusters, { timeout: 30 * SEC })
cy.get(dataLabel.clusters, { timeout: 120 * SEC })
.should('not.be.empty')
.should('not.contain.text', '0');
// Validating that amount of hosts is not empty and is not 0
cy.get(dataLabel.hosts, { timeout: 30 * SEC })
cy.get(dataLabel.hosts, { timeout: 120 * SEC })
.should('not.be.empty')
.should('not.contain.text', '0');
// Validating that amount of VMs is not empty and is not 0
cy.get(dataLabel.vms, { timeout: 30 * SEC }).should('not.be.empty');
cy.get(dataLabel.vms, { timeout: 120 * SEC }).should('not.be.empty');
// Validating that amount of networks is not empty and is not 0
cy.get(dataLabel.networks, { timeout: 30 * SEC })
cy.get(dataLabel.networks, { timeout: 120 * SEC })
.should('not.be.empty')
.should('not.contain.text', '0');
// Validating that amount of datastores is not empty and is not 0
cy.get(dataLabel.datastores, { timeout: 30 * SEC })
cy.get(dataLabel.datastores, { timeout: 120 * SEC })
.should('not.be.empty')
.should('not.contain.text', '0');
}
Expand Down
Expand Up @@ -11,8 +11,6 @@ import {
import { MappingNetwork } from '../../models/mappingNetwork';
import { MappingStorage } from '../../models/mappingStorage';
import { Plan } from '../../models/plan';
import { testData } from '../vmware/config_separate_mapping';
import { secondNetwork } from '../../types/constants';

vmwareTier0TestArray.forEach((currentTest) => {
describe(
Expand Down
22 changes: 8 additions & 14 deletions pkg/qe-tests/cypress/utils/utils.ts
Expand Up @@ -13,24 +13,24 @@ import { kebab, kebabDropDownItem } from '../integration/views/provider.view';
import { confirmButton } from '../integration/views/plan.view';

export function inputText(fieldId: string, text: string): void {
cy.get(fieldId, { timeout: 30 * SEC })
cy.get(fieldId, { timeout: 120 * SEC })
.last()
.clear()
.type(text);
}

// Clicking on button with selection by text (when no other selector can be used)
export function clickByText(fieldId: string, buttonText: string): void {
cy.contains(fieldId, buttonText, { timeout: 30 * SEC }).click();
cy.contains(fieldId, buttonText, { timeout: 120 * SEC }).click();
}

// Clicking on object selected by fieldId
export function click(fieldId: string): void {
cy.get(fieldId, { timeout: 30 * SEC }).click();
cy.get(fieldId, { timeout: 120 * SEC }).click();
}

export function login(loginData: LoginData): void {
cy.visit(loginData.url);
cy.visit(loginData.url, { timeout: 120 * SEC });
inputText(loginView.userNameInput, loginData.username);
inputText(loginView.userPasswordInput, loginData.password);
clickByText(button, loginButton);
Expand All @@ -39,7 +39,7 @@ export function login(loginData: LoginData): void {

export function openSidebarMenu(): void {
// Checking if sidebar is collapsed and opening it if required
cy.get(page_sidebar).then(($sidebar) => {
cy.get(page_sidebar, { timeout: 120 * SEC }).then(($sidebar) => {
if ($sidebar.hasClass(sidebar_collapsed)) {
click(nav_toggle);
}
Expand All @@ -49,7 +49,7 @@ export function openSidebarMenu(): void {
export function applyAction(itemName: string, action: string): void {
// itemName is text to be searched on the screen (like plan name, provider name, etc)
// Action is the name of the action to be applied
cy.contains(itemName)
cy.contains(itemName, { timeout: 120 * SEC })
.closest(trTag)
.within(() => {
click(kebab);
Expand All @@ -64,15 +64,15 @@ export function selectFromDroplist(selector: string, point: string): void {

//function to select checkboxes
export function selectCheckBox(selector: string): void {
cy.get(selector, { timeout: 60 * SEC }).then(($checkbox) => {
cy.get(selector, { timeout: 120 * SEC }).then(($checkbox) => {
if (!$checkbox.prop('checked')) {
click(selector);
}
});
}

export function unSelectCheckBox(selector: string): void {
cy.get(selector).then(($checkbox) => {
cy.get(selector, { timeout: 120 * SEC }).then(($checkbox) => {
if ($checkbox.prop('checked')) {
click(selector);
}
Expand Down Expand Up @@ -110,12 +110,6 @@ export function cleanVms(vm_list: string[], namespace: string): void {
});
}

export function preservecookies(): void {
Cypress.Cookies.defaults({
preserve: /SESSION/,
});
}

export function ocApply(yaml, namespace: string): void {
cy.exec(`oc project ${namespace}; cat <<EOF | oc apply -f - \n ${yaml} \nEOF`);
}
Expand Down

0 comments on commit 70e3063

Please sign in to comment.