Skip to content

SEAB-5762: Pagination for entry versions #2023

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

Merged
merged 27 commits into from
Dec 4, 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
- setup_integration_test
- run:
name: Test
command: bash -i -c 'npx cypress run --browser chrome --record --config numTestsKeptInMemory=1 --reporter junit --spec cypress/e2e/<< parameters.integration_test_name >>/**/*'
command: bash -i -c 'npx cypress run --record --config numTestsKeptInMemory=1 --reporter junit --spec cypress/e2e/<< parameters.integration_test_name >>/**/*'
no_output_timeout: 30m
environment:
MOCHA_FILE: integration-tests/test-results/junit/test-results-[hash].xml
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/group1/checkerWorkflowFromWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ describe('Checker workflow test from my-workflows', () => {
cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l');

goToTab('Versions');
cy.get('[data-cy=date-modified-header]').should('be.visible').click();
cy.wait(1000); //waits for the sorting to finish to ensure Actions button is clicked for the right version (was encountering flakiness)

cy.contains('button', 'Actions').click();
cy.get('[data-cy=set-default-version-button]').should('be.visible').click();
goToTab('Info');
Expand Down
30 changes: 30 additions & 0 deletions cypress/e2e/group2/myworkflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ describe('Dockstore my workflows part 2', () => {
cy.visit('/my-workflows/github.com/A/l');
cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l');
goToTab('Versions');
cy.get('[data-cy=date-modified-header]').should('be.visible').click();
cy.wait(1000);

cy.get('td').contains('Actions').click();
}

Expand Down Expand Up @@ -429,17 +432,33 @@ describe('Dockstore my workflows part 2', () => {
cy.get('[data-cy=dockstore-request-doi-button]').click();
cy.get('[data-cy=export-button').should('be.enabled');
cy.get('[data-cy=export-button').click();

cy.fixture('versionWithDoi.json').then((json) => {
cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', {
body: json,
statusCode: 200,
}).as('getVersionWithDoi');
});

// Should have DOI badges now
cy.get('[data-cy=user-DOI-icon]').should('be.visible');
cy.get('[data-cy=concept-DOI-badge]').should('be.visible');
cy.get('[data-cy=version-DOI-badge]').should('be.visible');
goToTab('Versions');
cy.get('td').contains('Actions').click();
cy.get('[data-cy=dockstore-request-doi-button').should('not.exist'); // Should not be able to request another DOI

// Export to ORCID
cy.get('[data-cy=dockstore-export-orcid-button]').click();
cy.get('[data-cy=export-button').should('be.enabled');
cy.get('[data-cy=export-button').click();
cy.fixture('versionAfterOrcidExport.json').then((json) => {
cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortCol=lastModified&sortOrder=asc', {
body: json,
statusCode: 200,
}).as('getVersionAfterOrcidExport');
});
goToTab('Versions');
cy.get('td').contains('Actions').click();
cy.get('[data-cy=dockstore-export-orcid-button]').should('not.exist'); // Should not be able to export to ORCID again
});
Expand Down Expand Up @@ -485,6 +504,8 @@ describe('Dockstore my workflows part 2', () => {
cy.visit('/my-workflows/github.com/A/l');
cy.url().should('eq', Cypress.config().baseUrl + '/my-workflows/github.com/A/l');
goToTab('Versions');
cy.get('[data-cy=date-modified-header]').should('be.visible').click();
cy.wait(1000);
cy.contains('button', 'Actions').click();
cy.contains('button', 'Refresh Version').should('not.be.disabled');
});
Expand All @@ -502,7 +523,14 @@ describe('Dockstore my workflows part 2', () => {
cy.get('[data-cy=refreshOrganization]:visible').should('be.visible').click();
cy.get('[data-cy=confirm-dialog-button] > .mat-button-wrapper').contains('Refresh').click();
cy.wait('@refreshWorkflow');

cy.fixture('sampleWorkflowVersion').then((json) => {
cy.intercept('GET', '/api/workflows/11/workflowVersions?limit=10&offset=0&sortOrder=desc', {
body: json,
}).as('getVersion');
});
goToTab('Versions');
cy.wait('@getVersion');
cy.get('table>tbody>tr').should('have.length', 1); // 2 Versions and no warning line
});

Expand Down Expand Up @@ -633,6 +661,8 @@ describe('Dockstore my workflows part 3', () => {
cy.get('#publishButton').should('contain', 'Publish').should('be.visible');

goToTab('Versions');
cy.get('[data-cy=date-modified-header]').should('be.visible').click();
cy.wait(1000);
cy.contains('button', 'Actions').click();
cy.get('[data-cy=set-default-version-button]').should('be.visible').click();
cy.wait(1000);
Expand Down
98 changes: 98 additions & 0 deletions cypress/fixtures/sampleWorkflowVersion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
{
"aliases": null,
"author": null,
"commitID": null,
"dbUpdateDate": 1480374119003,
"description": null,
"descriptionSource": null,
"dirtyBit": false,
"doiStatus": "NOT_REQUESTED",
"doiURL": null,
"dois": {},
"email": null,
"frozen": false,
"hidden": false,
"id": 13,
"images": null,
"input_file_formats": [],
"last_modified": 1480374117003,
"legacyVersion": true,
"name": "master",
"output_file_formats": [],
"reference": "master",
"referenceType": "UNSET",
"sourceFiles": [
{
"absolutePath": "/1st-workflow.cwl",
"checksums": null,
"content": "cwlVersion: v1.0\nclass: Workflow\ninputs:\n inp: File\n ex: string\n\noutputs:\n classout:\n type: File\n outputSource: compile/classfile\n\nsteps:\n untar:\n run: tar-param.cwl\n in:\n tarfile: inp\n extractfile: ex\n out: [example_out]\n\n compile:\n run: arguments.cwl\n in:\n src: untar/example_out\n out: [classfile]\n\n wrkflow:\n run: grep-and-count.cwl\n in:\n infiles: inp\n pattern: \"hello\"\n out: [outfile]\n",
"frozen": false,
"id": 28,
"path": "/1st-workflow.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
},
{
"absolutePath": "/arguments.cwl",
"checksums": null,
"content": "cwlVersion: v1.0\nclass: CommandLineTool\nlabel: Example trivial wrapper for Java 7 compiler\nbaseCommand: javac\nhints:\n - DockerRequirement:\n dockerPull: java:7\nbaseCommand: javac\narguments: [\"-d\", $(runtime.outdir)]\ninputs:\n src:\n type: File\n inputBinding:\n position: 1\noutputs:\n classfile:\n type: File\n outputBinding:\nglob: \"*.class\"\n",
"frozen": false,
"id": 31,
"path": "arguments.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
},
{
"absolutePath": "/grep-and-count.cwl",
"checksums": null,
"content": "class: Workflow\ncwlVersion: v1.0\n\nrequirements:\n - class: ScatterFeatureRequirement\n - class: DockerRequirement\n dockerPull: java:7\n\ninputs:\n pattern: string\n infiles: File[]\n\noutputs:\n outfile:\n type: File\n outputSource: wc/outfile\n\nsteps:\n grep:\n run: grep.cwl\n in:\n pattern: pattern\n infile: infiles\n scatter: infile\n out: [outfile]\n\n wc:\n run: wc.cwl\n in:\n infiles: grep/outfile\nout: [outfile]\n",
"frozen": false,
"id": 27,
"path": "grep-and-count.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
},
{
"absolutePath": "/grep.cwl",
"checksums": null,
"content": "#!/usr/bin/env cwl-runner\nclass: CommandLineTool\ncwlVersion: v1.0\n\ninputs:\n pattern:\n type: string\n inputBinding: {position: 0}\n infile:\n type: File\n inputBinding: {position: 1}\n\noutputs:\n outfile:\n type: stdout\n\nbaseCommand: grep\n",
"frozen": false,
"id": 29,
"path": "grep.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
},
{
"absolutePath": "/tar-param.cwl",
"checksums": null,
"content": "cwlVersion: v1.0\nclass: CommandLineTool\nbaseCommand: [tar, xf]\ninputs:\n tarfile:\n type: File\n inputBinding:\n position: 1\n extractfile:\n type: string\n inputBinding:\n position: 2\noutputs:\n example_out:\n type: File\n outputBinding:\nglob: $(inputs.extractfile)\n",
"frozen": false,
"id": 32,
"path": "tar-param.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
},
{
"absolutePath": "/wc.cwl",
"checksums": null,
"content": "#!/usr/bin/env cwl-runner\nclass: CommandLineTool\ncwlVersion: v1.0\n\ninputs:\n infiles:\n type: File[]\n inputBinding: {position: 1}\n\noutputs:\n outfile:\n type: stdout\n\nbaseCommand: [wc, -l]\n",
"frozen": false,
"id": 30,
"path": "wc.cwl",
"type": "DOCKSTORE_CWL",
"verifiedBySource": {}
}
],
"subClass": null,
"userIdToOrcidPutCode": {},
"valid": true,
"validations": null,
"verified": false,
"verifiedSource": null,
"verifiedSources": [],
"versionEditor": null,
"workflow_path": "/1st-workflow.cwl",
"workingDirectory": ""
}
]
94 changes: 94 additions & 0 deletions cypress/fixtures/versionAfterOrcidExport.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[
{
"aliases": null,
"author": null,
"authors": [],
"commitID": null,
"dbUpdateDate": 1622246514895,
"description": null,
"descriptionSource": null,
"dirtyBit": false,
"doiStatus": "CREATED",
"doiURL": "10.5072/zenodo.841014",
"dois": {
"USER": {
"type": "VERSION",
"name": "10.5072/zenodo.841014",
"initiator": "USER"
}
},
"email": null,
"frozen": true,
"hidden": false,
"id": 13,
"images": null,
"input_file_formats": [],
"last_modified": 1480374117003,
"legacyVersion": true,
"name": "master",
"orcidAuthors": [],
"output_file_formats": [],
"reference": "master",
"referenceType": "UNSET",
"subClass": null,
"synced": false,
"valid": true,
"validations": null,
"verified": false,
"verifiedSource": null,
"verifiedSources": [],
"versionEditor": null,
"versionMetadata": {
"id": 13,
"parsedInformationSet": null,
"userIdToOrcidPutCode": {
"1": {
"orcidPutCode":"1234567"
}
}
},
"workflow_path": "/1st-workflow.cwl",
"workingDirectory": ""
},
{
"aliases": null,
"author": null,
"authors": [],
"commitID": null,
"dbUpdateDate": 1480374117003,
"description": null,
"descriptionSource": null,
"dirtyBit": false,
"doiStatus": "NOT_REQUESTED",
"doiURL": null,
"dois": {},
"email": null,
"frozen": false,
"hidden": true,
"id": 14,
"images": null,
"input_file_formats": [],
"last_modified": 1480374117003,
"legacyVersion": true,
"name": "test",
"orcidAuthors": [],
"output_file_formats": [],
"reference": "test",
"referenceType": "UNSET",
"subClass": null,
"synced": false,
"valid": true,
"validations": null,
"verified": false,
"verifiedSource": null,
"verifiedSources": [],
"versionEditor": null,
"versionMetadata": {
"id": 14,
"parsedInformationSet": null,
"userIdToOrcidPutCode": {}
},
"workflow_path": "/1st-workflow.cwl",
"workingDirectory": ""
}
]
Loading