})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
// Key: Color (IDTAGCOLORS) - Value: Magenta (IDVALCOLORS3)
cy.get('[data-cy=resource-properties-form]').within(() => {
head_uuid: this.sharedGroup.uuid,
tail_uuid: activeUser.user.uuid
})
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
// Check that name & uuid are correct.
cy.get('[data-cy=collection-info-panel]')
})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
const names = [
'bar', // initial name already set
})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
['subdir', 'G%C3%BCnter\'s%20file', 'table%&?*2'].forEach((subdir) => {
cy.get('[data-cy=collection-files-panel]')
})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
const illegalNamesFromUI = [
['.', "Name cannot be '.' or '..'"],
});
// Check the old version displays as what it is.
cy.loginAs(activeUser)
- cy.doSearch(`${oldVersionUuid}`);
+ cy.goToPath(`/collections/${oldVersionUuid}`);
cy.get('[data-cy=collection-info-panel]').should('contain', 'This is an old version');
cy.get('[data-cy=read-only-icon]').should('exist');
.as('collection').then(function () {
// Visit collection, check basic information
cy.loginAs(activeUser)
- cy.doSearch(`${this.collection.uuid}`);
+ cy.goToPath(`/collections/${this.collection.uuid}`);
cy.get('[data-cy=collection-info-panel]').should('not.contain', 'This is an old version');
cy.get('[data-cy=read-only-icon]').should('not.exist');
it('creates new collection on home project', function () {
cy.loginAs(activeUser);
- cy.doSearch(`${activeUser.user.uuid}`);
+ cy.goToPath(`/projects/${activeUser.user.uuid}`);
cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
cy.get('[data-cy=breadcrumb-last]').should('not.exist');
// Create new collection
})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
cy.get('[data-cy=collection-files-panel]').within(() => {
cy.get('[type="checkbox"]').first().check();
})
.as('testCollection').then(function () {
cy.loginAs(activeUser);
- cy.doSearch(`${this.testCollection.uuid}`);
+ cy.goToPath(`/collections/${this.testCollection.uuid}`);
cy.get('[data-cy=virtual-file-tree] > div > i').first().click();
cy.get('[data-cy=collection-files-panel]')
.then(function ([mySharedWritableProject, mySharedReadonlyProject, myProject1, testCollection]) {
cy.loginAs(activeUser);
- cy.doSearch(`${activeUser.user.uuid}`);
-
cy.contains(testCollection.name).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Move to').click();
cy.get('[data-cy=form-submit-btn]').click();
});
- cy.doSearch(`${mySharedWritableProject.uuid}`);
+ cy.goToPath(`/projects/${mySharedWritableProject.uuid}`);
cy.get('main').contains(testCollection.name);
});
});
cy.getAll('@mySharedWritableProject', '@mySharedReadonlyProject', '@myProject1')
.then(function ([mySharedWritableProject, mySharedReadonlyProject, myProject1]) {
- cy.loginAs(activeUser);
-
cy.createWorkflow(adminUser.token, {
name: `TestWorkflow${Math.floor(Math.random() * 999999)}.cwl`,
definition: "{\n \"$graph\": [\n {\n \"class\": \"Workflow\",\n \"doc\": \"Reverse the lines in a document, then sort those lines.\",\n \"hints\": [\n {\n \"acrContainerImage\": \"99b0201f4cade456b4c9d343769a3b70+261\",\n \"class\": \"http://arvados.org/cwl#WorkflowRunnerResources\"\n }\n ],\n \"id\": \"#main\",\n \"inputs\": [\n {\n \"default\": null,\n \"doc\": \"The input file to be processed.\",\n \"id\": \"#main/input\",\n \"type\": \"File\"\n },\n {\n \"default\": true,\n \"doc\": \"If true, reverse (decending) sort\",\n \"id\": \"#main/reverse_sort\",\n \"type\": \"boolean\"\n }\n ],\n \"outputs\": [\n {\n \"doc\": \"The output with the lines reversed and sorted.\",\n \"id\": \"#main/output\",\n \"outputSource\": \"#main/sorted/output\",\n \"type\": \"File\"\n }\n ],\n \"steps\": [\n {\n \"id\": \"#main/rev\",\n \"in\": [\n {\n \"id\": \"#main/rev/input\",\n \"source\": \"#main/input\"\n }\n ],\n \"out\": [\n \"#main/rev/output\"\n ],\n \"run\": \"#revtool.cwl\"\n },\n {\n \"id\": \"#main/sorted\",\n \"in\": [\n {\n \"id\": \"#main/sorted/input\",\n \"source\": \"#main/rev/output\"\n },\n {\n \"id\": \"#main/sorted/reverse\",\n \"source\": \"#main/reverse_sort\"\n }\n ],\n \"out\": [\n \"#main/sorted/output\"\n ],\n \"run\": \"#sorttool.cwl\"\n }\n ]\n },\n {\n \"baseCommand\": \"rev\",\n \"class\": \"CommandLineTool\",\n \"doc\": \"Reverse each line using the `rev` command\",\n \"hints\": [\n {\n \"class\": \"ResourceRequirement\",\n \"ramMin\": 8\n }\n ],\n \"id\": \"#revtool.cwl\",\n \"inputs\": [\n {\n \"id\": \"#revtool.cwl/input\",\n \"inputBinding\": {},\n \"type\": \"File\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"#revtool.cwl/output\",\n \"outputBinding\": {\n \"glob\": \"output.txt\"\n },\n \"type\": \"File\"\n }\n ],\n \"stdout\": \"output.txt\"\n },\n {\n \"baseCommand\": \"sort\",\n \"class\": \"CommandLineTool\",\n \"doc\": \"Sort lines using the `sort` command\",\n \"hints\": [\n {\n \"class\": \"ResourceRequirement\",\n \"ramMin\": 8\n }\n ],\n \"id\": \"#sorttool.cwl\",\n \"inputs\": [\n {\n \"id\": \"#sorttool.cwl/reverse\",\n \"inputBinding\": {\n \"position\": 1,\n \"prefix\": \"-r\"\n },\n \"type\": \"boolean\"\n },\n {\n \"id\": \"#sorttool.cwl/input\",\n \"inputBinding\": {\n \"position\": 2\n },\n \"type\": \"File\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"#sorttool.cwl/output\",\n \"outputBinding\": {\n \"glob\": \"output.txt\"\n },\n \"type\": \"File\"\n }\n ],\n \"stdout\": \"output.txt\"\n }\n ],\n \"cwlVersion\": \"v1.0\"\n}",
})
.as('testWorkflow2');
- cy.contains('Shared with me').click();
-
- cy.doSearch(`${activeUser.user.uuid}`);
+ cy.loginAs(activeUser);
cy.get('main').contains(myProject1.name).click();
});
it('shows not found page', function() {
- // given
- const invalidUUID = '1212r12r12r12r12r12r21r'
-
// when
cy.loginAs(adminUser);
- cy.visit(`/collections/${invalidUUID}`);
+ cy.goToPath(`/this/is/an/invalid/route`);
// then
cy.get('[data-cy=not-found-page]').should('exist');
// when
cy.loginAs(adminUser);
- cy.visit(`/projects/${notExistingUUID}`);
+ cy.goToPath(`/projects/${notExistingUUID}`);
// then
- cy.get('[data-cy=not-found-page]').should('not.exist');
cy.get('[data-cy=not-found-content]').should('exist');
+ cy.get('[data-cy=not-found-page]').should('not.exist');
});
})
\ No newline at end of file
}
cy.loginAs(activeUser);
- cy.doSearch(`${activeUser.user.uuid}`);
+ cy.goToPath(`/projects/${activeUser.user.uuid}`);
cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
cy.get('[data-cy=breadcrumb-last]').should('not.exist');
// Create new project
it('enables the +NEW side panel button on users home project', function() {
cy.loginAs(activeUser);
- cy.doSearch(`${activeUser.user.uuid}`);
cy.get('[data-cy=side-panel-button]')
.should('exist')
.and('not.be.disabled');
head_uuid: this.sharedGroup.uuid,
tail_uuid: activeUser.user.uuid
})
- cy.doSearch(`${this.sharedGroup.uuid}`);
+ cy.goToPath(`/projects/${this.sharedGroup.uuid}`);
cy.get('[data-cy=side-panel-button]')
.should('exist')
.and(`${isWritable ? 'not.' : ''}be.disabled`);
{url: '/all_processes', label: 'All Processes'},
{url: '/trash', label: 'Trash'},
].map(function(section) {
- cy.visit(section.url);
+ cy.goToPath(section.url);
cy.get('[data-cy=breadcrumb-first]')
.should('contain', section.label);
cy.get('[data-cy=side-panel-button]')
properties: {filters: []},
}).as('myFavoriteFilterGroup').then(function (myFavoriteFilterGroup) {
cy.contains('Refresh').click();
- cy.doSearch(`${myFavoriteFilterGroup.uuid}`);
+ cy.goToPath(`/projects/${myFavoriteFilterGroup.uuid}`);
cy.get('[data-cy=breadcrumb-last]').should('contain', 'my-favorite-filter-group');
cy.get('[data-cy=side-panel-button]')
Cypress.Commands.add(
"loginAs", (user) => {
cy.visit(`/token/?api_token=${user.token}`);
- cy.url().should('contain', '/projects/');
+ cy.url({timeout: 10000}).should('contain', '/projects/');
cy.get('div#root').should('contain', 'Arvados Workbench (zzzzz)');
cy.get('div#root').should('not.contain', 'Your account is inactive');
}
}
)
+Cypress.Commands.add(
+ "goToPath", (path) => {
+ return cy.window().its('appHistory').invoke('push', path);
+ }
+)
+
Cypress.Commands.add('getAll', (...elements) => {
const promise = cy.wrap([], { log: false })
fetchConfig()
.then(({ config, apiHost }) => {
const history = createBrowserHistory();
+
+ // Provide browser's history access to Cypress to allow programmatic
+ // navigation.
+ if ((window as any).Cypress) {
+ (window as any).appHistory = history;
+ }
+
const services = createServices(config, {
progressFn: (id, working) => {
store.dispatch(progressIndicatorActions.TOGGLE_WORKING({ id, working }));