Skip to content

Commit 5f6f5b6

Browse files
author
Charles Overbeck
committed
Let's see if reorganizing tests makes a difference.
1 parent 37ea1d5 commit 5f6f5b6

File tree

2 files changed

+117
-120
lines changed

2 files changed

+117
-120
lines changed

cypress/e2e/smokeTests/sharedTests/auth-tests.ts

+116-119
Original file line numberDiff line numberDiff line change
@@ -188,138 +188,135 @@ function toggleHiddenWorkflowVersion() {
188188
cy.contains('button', 'Save Changes').click();
189189
}
190190

191-
function testTool(registry: string, repo: string, name: string) {
192-
describe('Register, publish, unpublish, and delete a tool', () => {
193-
registerQuayTool(repo, name);
194-
unpublishTool();
195-
deleteTool();
191+
describe('add entry to and remove from collection', () => {
192+
const repo = toolTuple[1];
193+
const name = toolTuple[2];
194+
const org = collectionTuple[0];
195+
const collection = collectionTuple[1];
196+
registerQuayTool(repo, name);
197+
it('be able to add an entry to the collection ' + collection, () => {
198+
storeToken();
199+
// define routes to watch for
200+
cy.intercept('post', '**/collections/**').as('postToCollection');
201+
cy.visit(`/containers/quay.io/${repo}/${name}:develop?tab=info`);
202+
cy.get('#addToolToCollectionButton').should('be.visible').click();
203+
cy.get('#addEntryToCollectionButton').should('be.disabled');
204+
cy.get('#selectOrganization').should('be.visible').click();
205+
cy.get('mat-option').contains(org).should('be.visible').click();
206+
cy.get('#addEntryToCollectionButton').should('be.disabled');
207+
cy.get('#selectCollection').should('be.visible').click();
208+
cy.get('mat-option').contains(collection).click();
209+
cy.get('#addEntryToCollectionButton').should('not.be.disabled').click();
210+
cy.wait('@postToCollection');
211+
cy.get('#addEntryToCollectionButton').should('not.exist');
212+
cy.get('mat-progress-bar').should('not.exist');
213+
});
196214

197-
registerRemoteSitesTool(repo, name);
198-
unpublishTool();
199-
deleteTool();
215+
it('be able to remove an entry from a collection ' + collection, () => {
216+
storeToken();
217+
cy.visit(`/organizations/${org}/collections/${collection}`);
218+
cy.contains(`quay.io/${repo}/${name}`);
219+
cy.get('#removeEntryButton').should('be.visible').click();
220+
cy.get('[data-cy=accept-remove-entry-from-org]').should('be.visible').click();
221+
cy.contains('This collection has no associated entries');
222+
cy.visit(`/organizations/${org}`);
223+
cy.contains('Members').should('be.visible');
200224

201-
registerToolOnDockstore(repo, name);
202-
deleteTool();
225+
cy.intercept('**/tokens').as('tokens');
226+
cy.visit('/my-tools');
227+
cy.wait('@tokens');
203228
});
204-
205-
describe('Hide and un-hide a tool version', () => {
206-
registerQuayTool(repo, name);
207-
it('hide a version', () => {
208-
storeToken();
209-
cy.visit('/my-tools');
210-
goToTab('Versions');
211-
toggleHiddenToolVersion();
212-
cy.get('[data-cy=hiddenCheck]').should('have.length', 1);
213-
// un-hide and verify
214-
toggleHiddenToolVersion();
215-
cy.get('[data-cy=hiddenCheck]').should('not.exist');
216-
});
217-
it('refresh namespace', () => {
218-
storeToken();
219-
cy.visit('/my-tools');
220-
cy.contains('button', 'Refresh Namespace').first().click();
221-
// check that the 'refresh succeeded' message appears
222-
cy.contains('succeeded');
223-
});
224-
unpublishTool();
225-
deleteTool();
229+
unpublishTool();
230+
deleteTool();
231+
});
232+
describe('Register, publish, unpublish, and delete a tool', () => {
233+
const repo = toolTuple[1];
234+
const name = toolTuple[2];
235+
registerQuayTool(repo, name);
236+
unpublishTool();
237+
deleteTool();
238+
239+
registerRemoteSitesTool(repo, name);
240+
unpublishTool();
241+
deleteTool();
242+
243+
registerToolOnDockstore(repo, name);
244+
deleteTool();
245+
});
246+
247+
describe('Hide and un-hide a tool version', () => {
248+
const repo = toolTuple[1];
249+
const name = toolTuple[2];
250+
registerQuayTool(repo, name);
251+
it('hide a version', () => {
252+
storeToken();
253+
cy.visit('/my-tools');
254+
goToTab('Versions');
255+
toggleHiddenToolVersion();
256+
cy.get('[data-cy=hiddenCheck]').should('have.length', 1);
257+
// un-hide and verify
258+
toggleHiddenToolVersion();
259+
cy.get('[data-cy=hiddenCheck]').should('not.exist');
226260
});
227-
}
228-
229-
function testWorkflow(registry: string, repo: string, name: string) {
230-
describe('Refresh, publish, unpublish, and restub a workflow', () => {
231-
it('refresh and publish', () => {
232-
storeToken();
233-
234-
// define routes to watch for
235-
cy.intercept('**/tokens').as('tokens');
236-
cy.intercept('**/workflows/path/workflow/**').as('workflow');
237-
238-
cy.visit(`/my-workflows`);
239-
cy.wait('@tokens');
240-
cy.wait('@workflow');
261+
it('refresh namespace', () => {
262+
storeToken();
263+
cy.visit('/my-tools');
264+
cy.contains('button', 'Refresh Namespace').first().click();
265+
// check that the 'refresh succeeded' message appears
266+
cy.contains('succeeded');
267+
});
268+
unpublishTool();
269+
deleteTool();
270+
});
241271

242-
// refresh stubbed workflow to full and publish
243-
cy.intercept('**/refresh?hardRefresh=false').as('refresh');
244-
cy.get('[data-cy=refreshButton]').click();
245-
cy.wait('@refresh');
246-
cy.intercept('post', '**/publish').as('publish');
247-
cy.contains('button', 'Publish').should('be.enabled').click();
248-
cy.wait('@publish');
272+
describe('Refresh, publish, unpublish, and restub a workflow', () => {
273+
it('refresh and publish', () => {
274+
storeToken();
249275

250-
// Test some snapshot and versions stuff
251-
// WARNING: don't actually snapshot since it can't be undone
252-
// define routes to watch for
276+
// define routes to watch for
277+
cy.intercept('**/tokens').as('tokens');
278+
cy.intercept('**/workflows/path/workflow/**').as('workflow');
253279

254-
goToTab('Versions');
280+
cy.visit(`/my-workflows`);
281+
cy.wait('@tokens');
282+
cy.wait('@workflow');
255283

256-
cy.contains('button', 'Actions').should('be.visible');
257-
cy.contains('td', 'Actions').first().click();
258-
cy.get('.mat-menu-content').within(() => {
259-
cy.contains('button', 'Snapshot');
260-
cy.contains('button', 'Edit').click();
261-
});
262-
cy.contains('button', 'Cancel').click();
284+
// refresh stubbed workflow to full and publish
285+
cy.intercept('**/refresh?hardRefresh=false').as('refresh');
286+
cy.get('[data-cy=refreshButton]').click();
287+
cy.wait('@refresh');
288+
cy.intercept('post', '**/publish').as('publish');
289+
cy.contains('button', 'Publish').should('be.enabled').click();
290+
cy.wait('@publish');
263291

264-
storeToken();
265-
cy.get('#publishButton').contains('Unpublish').click({ force: true });
292+
// Test some snapshot and versions stuff
293+
// WARNING: don't actually snapshot since it can't be undone
294+
// define routes to watch for
266295

267-
goToTab('Info');
268-
cy.contains('button', 'Restub').click();
269-
cy.contains('button', 'Publish').should('be.disabled');
296+
goToTab('Versions');
270297

271-
cy.get('[data-cy=refreshButton]').click();
272-
goToTab('Versions');
273-
// hide
274-
toggleHiddenWorkflowVersion();
275-
cy.get('[data-cy=hidden]').should('have.length', 1);
276-
// un-hide
277-
toggleHiddenWorkflowVersion();
278-
cy.get('[data-cy=hidden]').should('not.exist');
298+
cy.contains('button', 'Actions').should('be.visible');
299+
cy.contains('td', 'Actions').first().click();
300+
cy.get('.mat-menu-content').within(() => {
301+
cy.contains('button', 'Snapshot');
302+
cy.contains('button', 'Edit').click();
279303
});
280-
});
281-
}
304+
cy.contains('button', 'Cancel').click();
282305

283-
function testCollection(org: string, collection: string, registry: string, repo: string, name: string) {
284-
describe('add entry to and remove from collection', () => {
285-
registerQuayTool(repo, name);
286-
it('be able to add an entry to the collection', () => {
287-
storeToken();
288-
// define routes to watch for
289-
cy.intercept('post', '**/collections/**').as('postToCollection');
290-
cy.visit(`/containers/quay.io/${repo}/${name}:develop?tab=info`);
291-
cy.get('#addToolToCollectionButton').should('be.visible').click();
292-
cy.get('#addEntryToCollectionButton').should('be.disabled');
293-
cy.get('#selectOrganization').should('be.visible').click();
294-
cy.get('mat-option').contains(org).should('be.visible').click();
295-
cy.get('#addEntryToCollectionButton').should('be.disabled');
296-
cy.get('#selectCollection').should('be.visible').click();
297-
cy.get('mat-option').contains(collection).click();
298-
cy.get('#addEntryToCollectionButton').should('not.be.disabled').click();
299-
cy.wait('@postToCollection');
300-
cy.get('#addEntryToCollectionButton').should('not.exist');
301-
cy.get('mat-progress-bar').should('not.exist');
302-
});
306+
storeToken();
307+
cy.get('#publishButton').contains('Unpublish').click({ force: true });
303308

304-
it('be able to remove an entry from a collection', () => {
305-
storeToken();
306-
cy.visit(`/organizations/${org}/collections/${collection}`);
307-
cy.contains(`quay.io/${repo}/${name}`);
308-
cy.get('#removeEntryButton').should('be.visible').click();
309-
cy.get('[data-cy=accept-remove-entry-from-org]').should('be.visible').click();
310-
cy.contains('This collection has no associated entries');
311-
cy.visit(`/organizations/${org}`);
312-
cy.contains('Members').should('be.visible');
309+
goToTab('Info');
310+
cy.contains('button', 'Restub').click();
311+
cy.contains('button', 'Publish').should('be.disabled');
313312

314-
cy.intercept('**/tokens').as('tokens');
315-
cy.visit('/my-tools');
316-
cy.wait('@tokens');
317-
});
318-
unpublishTool();
319-
deleteTool();
313+
cy.get('[data-cy=refreshButton]').click();
314+
goToTab('Versions');
315+
// hide
316+
toggleHiddenWorkflowVersion();
317+
cy.get('[data-cy=hidden]').should('have.length', 1);
318+
// un-hide
319+
toggleHiddenWorkflowVersion();
320+
cy.get('[data-cy=hidden]').should('not.exist');
320321
});
321-
}
322-
323-
testCollection(collectionTuple[0], collectionTuple[1], toolTuple[0], toolTuple[1], toolTuple[2]);
324-
testTool(toolTuple[0], toolTuple[1], toolTuple[2]);
325-
testWorkflow(workflowTuple[0], workflowTuple[1], workflowTuple[2]);
322+
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"test-staging-no-auth": "npx cypress run -c baseUrl=https://staging.dockstore.org -s \"cypress/e2e/smokeTests/stagingOnly/monitor.ts,cypress/e2e/smokeTests/stagingOnly/basic-enduser.ts,cypress/e2e/smokeTests/stagingOnly/search.ts,cypress/e2e/smokeTests/sharedTests/monitor.ts,cypress/e2e/smokeTests/sharedTests/basic-enduser.ts,cypress/e2e/smokeTests/sharedTests/search.ts,cypress/e2e/smokeTests/sharedTests/secheaders.ts\"",
3333
"test-prod-no-auth": "npx cypress run -c baseUrl=https://dockstore.org -s \"cypress/e2e/smokeTests/prodOnly/monitor.ts,cypress/e2e/smokeTests/prodOnly/basic-enduser.ts,cypress/e2e/smokeTests/prodOnly/search.ts,cypress/e2e/smokeTests/prodOnly/basic-enduser-prod-only.ts,cypress/e2e/smokeTests/sharedTests/monitor.ts,cypress/e2e/smokeTests/sharedTests/basic-enduser.ts,cypress/e2e/smokeTests/sharedTests/search.ts,cypress/e2e/smokeTests/sharedTests/secheaders.ts\"",
3434
"test-local-auth": "npx cypress run --headed -c baseUrl=http://localhost:4200 -s \"cypress/e2e/smokeTests/sharedTests/auth-tests.ts\"",
35-
"test-qa-auth": "npx cypress run -c baseUrl=https://qa.dockstore.org -s \"cypress/e2e/smokeTests/qaOnly/auth-tests.ts,cypress/e2e/smokeTests/sharedTests/auth-tests.ts\"",
35+
"test-qa-auth": "npx cypress run --record --reporter junit -c baseUrl=https://qa.dockstore.org -s \"cypress/e2e/smokeTests/qaOnly/auth-tests.ts,cypress/e2e/smokeTests/sharedTests/auth-tests.ts\"",
3636
"test-staging-auth": "npx cypress run -c baseUrl=https://staging.dockstore.org -s \"cypress/e2e/smokeTests/stagingOnly/auth-tests.ts,cypress/e2e/smokeTests/sharedTests/auth-tests.ts\"",
3737
"test-prod-auth": "npx cypress run -c baseUrl=https://dockstore.org -s \"cypress/e2e/smokeTests/prodOnly/auth-tests.ts,cypress/e2e/smokeTests/sharedTests/auth-tests.ts\"",
3838
"prepare": "husky install",

0 commit comments

Comments
 (0)