Skip to content

Commit

Permalink
increase defaltCommandTimeout, remove some custom timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Jun 27, 2024
1 parent b8f16ec commit fb599f1
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 53 deletions.
1 change: 1 addition & 0 deletions test/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = defineConfig({
viewportWidth: 1280,
viewportHeight: 800,
e2e: {
defaultCommandTimeout: 20000,
setupNodeEvents(on, _config) {
if (process.env.CONSOLE_LOG_TO_TERMINAL) {
return require('./cypress/plugins/console-logger').install(on);
Expand Down
4 changes: 0 additions & 4 deletions test/cypress/e2e/approval-modal/approval-multiple-repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function rejectItem(repo) {
menuActionClick(repo, 'Reject');
cy.contains(
'Certification status for collection "namespace collection1 v1.0.0" has been successfully updated.',
{ timeout: 10000 },
);
cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('Clear all filters').click();
Expand Down Expand Up @@ -113,7 +112,6 @@ describe('Approval Dashboard process with multiple repos', () => {
cy.contains('button', 'Select').click();
cy.contains(
'Certification status for collection "namespace collection1 v1.0.0" has been successfully updated.',
{ timeout: 20000 },
);

cy.visit(`${uiPrefix}approval-dashboard`);
Expand Down Expand Up @@ -144,7 +142,6 @@ describe('Approval Dashboard process with multiple repos', () => {
cy.contains('button', 'Select').click();
cy.contains(
'Certification status for collection "namespace collection1 v1.0.0" has been successfully updated.',
{ timeout: 20000 },
);

cy.visit(`${uiPrefix}approval-dashboard`);
Expand Down Expand Up @@ -183,7 +180,6 @@ describe('Approval Dashboard process with multiple repos', () => {
cy.contains('button', 'Select').click();
cy.contains(
'Certification status for collection "namespace collection1 v1.0.0" has been successfully updated.',
{ timeout: 20000 },
);

cy.visit(`${uiPrefix}approval-dashboard`);
Expand Down
4 changes: 2 additions & 2 deletions test/cypress/e2e/approval/approval-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Approval Dashboard process', () => {
cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('[data-cy^="ApprovalRow"]', 'Needs review');
cy.contains('[data-cy^="ApprovalRow"] button', 'Sign and approve').click();
cy.contains('.body', 'No results found', { timeout: 8000 });
cy.contains('.body', 'No results found');
cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('button', 'Clear all filters').click();
cy.contains('[data-cy^="ApprovalRow"]', 'Signed and approved');
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('Approval Dashboard process', () => {
cy.wait(10000);
cy.contains('My imports');
cy.get('.pf-v5-c-label__content').contains('Running').should('exist');
cy.wait('@upload', { timeout: 10000 });
cy.wait('@upload');
cy.wait(5000);
cy.get('.pf-v5-c-label__content').contains('Failed').should('not.exist');
cy.get('.pf-v5-c-label__content').contains('Completed').should('exist');
Expand Down
5 changes: 1 addition & 4 deletions test/cypress/e2e/approval/signing.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ describe('signing versions - auto sign on approval', () => {

// Go and check if it is signed in the collections
cy.visit(`${uiPrefix}collections`);
cy.get('[data-cy="signature-badge"]', { timeout: 20000 }).should(
'have.length',
1,
);
cy.get('[data-cy="signature-badge"]').should('have.length', 1);
cy.get('[data-cy="signature-badge"]').first().should('contain', 'Signed');

// Optimization: check the signature button too here
Expand Down
10 changes: 3 additions & 7 deletions test/cypress/e2e/collections/collection-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ describe('Collection detail', () => {
function deprecate() {
cy.openHeaderKebab();
cy.contains('Deprecate').click();
cy.contains('This collection has been deprecated.', { timeout: 10000 });
cy.contains('This collection has been deprecated.');
}

function undeprecate() {
cy.openHeaderKebab();
cy.contains('Undeprecate').click();
cy.contains('This collection has been deprecated.', {
timeout: 10000,
}).should('not.exist');
cy.contains('This collection has been deprecated.').should('not.exist');
}

before(() => {
Expand Down Expand Up @@ -80,9 +78,7 @@ describe('Collection detail', () => {
}

if (tab.name == 'Import log') {
cy.contains('.body', 'Approval status', {
timeout: 10000,
});
cy.contains('.body', 'Approval status');
}

if (tab.name == 'Contents') {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/collections/collection-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('Collection Upload Tests', () => {
cy.get('[data-cy="confirm-upload"]').click();
cy.wait('@upload');
cy.contains('My imports');
cy.get('.pf-v5-c-label__content').contains('Completed', { timeout: 15000 });
cy.get('.pf-v5-c-label__content').contains('Completed');
cy.get('.pf-v5-c-label__content').contains('Failed').should('not.exist');
cy.get('.pf-v5-c-label__content').contains('Running').should('not.exist');
});
Expand Down
8 changes: 1 addition & 7 deletions test/cypress/e2e/collections/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('collection tests', () => {
cy.get('[data-cy=delete-collection]').click();
cy.get('input[id=delete_confirm]').click();
cy.get('button').contains('Delete').click();
cy.contains('No collections yet', { timeout: 10000 });
cy.contains('No collections yet');
});

it('deletes a collection version', () => {
Expand Down Expand Up @@ -113,9 +113,6 @@ describe('collection tests', () => {
cy.get('button').contains('Delete').click();
cy.contains(
'Collection "test_repo_collection2" has been successfully deleted.',
{
timeout: 10000,
},
);
cy.contains('[data-cy="CollectionListItem"]', 'repo2');
cy.contains('[data-cy="CollectionListItem"]', 'Published').should(
Expand Down Expand Up @@ -167,9 +164,6 @@ describe('collection tests', () => {
cy.get('button').contains('Delete').click();
cy.contains(
'Collection "test_repo_collection_version2 v1.0.0" has been successfully deleted.',
{
timeout: 10000,
},
);

cy.visit(
Expand Down
14 changes: 4 additions & 10 deletions test/cypress/e2e/collections/collections-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ describe('Collections list Tests', () => {

cy.get('.collection-container [aria-label="Actions"]').click();
cy.contains('Deprecate').click();
cy.contains('No results found', { timeout: 10000 });
cy.contains('No results found');
}

function undeprecate() {
cy.visit(`${uiPrefix}repo/published/my_namespace/my_collection0`);
cy.contains('This collection has been deprecated.');
cy.openHeaderKebab();
cy.contains('Undeprecate').click();
cy.contains('This collection has been deprecated.', {
timeout: 10000,
}).should('not.exist');
cy.contains('This collection has been deprecated.').should('not.exist');
}

function undeprecateIfDeprecated() {
Expand Down Expand Up @@ -138,9 +136,7 @@ describe('Collections list Tests', () => {
cy.contains('Delete collection from system').click();
cy.get('[data-cy=modal_checkbox] input').click();
cy.get('[data-cy=delete-button] button').click();
cy.contains('Collection "my_collection0" has been successfully deleted.', {
timeout: 15000,
});
cy.contains('Collection "my_collection0" has been successfully deleted.');
cy.contains('No results found');
});

Expand All @@ -156,9 +152,7 @@ describe('Collections list Tests', () => {
cy.get('[data-cy=modal_checkbox] input').click();
cy.get('[data-cy=delete-button] button').click();

cy.contains('Collection "my_collection1" has been successfully deleted.', {
timeout: 15000,
});
cy.contains('Collection "my_collection1" has been successfully deleted.');
cy.contains('No results found');
});
});
2 changes: 1 addition & 1 deletion test/cypress/e2e/namespaces/rbac-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function testAccessTab({
cy.get(
`[data-cy="RoleListTable-ExpandableRow-row-${role}"] .pf-v5-c-table__toggle button`,
).click();
cy.contains('.pf-v5-c-label', permissionLabel, { timeout: 10000 });
cy.contains('.pf-v5-c-label', permissionLabel);

// role list view, remove
cy.get(
Expand Down
12 changes: 3 additions & 9 deletions test/cypress/e2e/repo/container-signing.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ describe('Container Signing', () => {
cy.login();
cy.visit(`${uiPrefix}containers/remote1`);
cy.contains('[data-cy="column-section"]', 'remote1');
cy.contains('.hub-header-bottom', 'Unsigned', {
timeout: 10000,
});
cy.contains('.hub-header-bottom', 'Unsigned');

cy.contains('Last updated from registry');

Expand All @@ -70,9 +68,7 @@ describe('Container Signing', () => {
cy.login();
cy.visit(`${uiPrefix}containers/remote2`);
cy.contains('[data-cy="column-section"]', 'remote2');
cy.contains('.hub-header-bottom', 'Unsigned', {
timeout: 10000,
});
cy.contains('.hub-header-bottom', 'Unsigned');

cy.get('button[aria-label="Actions"]').click();
cy.contains('.pf-v5-c-dropdown ul li a', 'Sign').click();
Expand All @@ -83,9 +79,7 @@ describe('Container Signing', () => {
cy.login();
cy.visit(`${uiPrefix}containers/local1`);
cy.contains('[data-cy="column-section"]', 'local1');
cy.contains('.hub-header-bottom', 'Unsigned', {
timeout: 10000,
});
cy.contains('.hub-header-bottom', 'Unsigned');

cy.get('button[aria-label="Actions"]').click();
cy.contains('.pf-v5-c-dropdown ul li a', 'Sign').click();
Expand Down
6 changes: 2 additions & 4 deletions test/cypress/e2e/repo/imports-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,15 @@ describe('Imports filter test', () => {
);
cy.get(
'[data-cy="MyImports"] [data-cy="ImportConsole"] .title-bar',
).contains('Completed', { timeout: 10000 });
).contains('Completed');
cy.get(
'[data-cy="MyImports"] [data-cy="ImportConsole"] .message-list',
).contains('Done');
});

it('should be able to switch between namespaces', () => {
cy.get('button[aria-label="Clear all"]').click();
cy.contains('[data-cy="import-list-data"]', 'No namespace selected.', {
timeout: 8000,
});
cy.contains('[data-cy="import-list-data"]', 'No namespace selected.');

cy.intercept(
'GET',
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/repo/remote-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Remote Registry Tests', () => {

cy.get(
'[data-cy="ExecutionEnvironmentRegistryList-row-New remote registry1"]',
).contains('Completed', { timeout: 10000 });
).contains('Completed');
});

it('users can index only redhat.registry.io', () => {
Expand Down
4 changes: 1 addition & 3 deletions test/cypress/e2e/repo/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ function versionCheck(version) {

cy.contains('Sync started for repository "repo1Test".');
cy.contains('a', 'detail page').click();
cy.get('.pf-v5-c-label__content').contains('Failed', {
timeout: 15000,
});
cy.get('.pf-v5-c-label__content').contains('Failed');
}
});

Expand Down

0 comments on commit fb599f1

Please sign in to comment.