1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 describe('Collection panel tests', function() {
10 // Only set up common users once. These aren't set up as aliases because
11 // aliases are cleaned up after every test. Also it doesn't make sense
12 // to set the same users on beforeEach() over and over again, so we
13 // separate a little from Cypress' 'Best Practices' here.
14 cy.getUser('admin', 'Admin', 'User', true, true)
15 .as('adminUser').then(function() {
16 adminUser = this.adminUser;
19 cy.getUser('collectionuser1', 'Collection', 'User', false, true)
20 .as('activeUser').then(function() {
21 activeUser = this.activeUser;
26 beforeEach(function() {
28 cy.clearLocalStorage()
31 it('creates and removes a public favorite', function() {
32 cy.loginAs(adminUser);
33 cy.createGroup(adminUser.token, {
34 name: `my-favorite-project`,
35 group_class: 'project',
36 }).as('myFavoriteProject').then(function() {
37 cy.contains('Refresh').click();
38 cy.get('main').contains('my-favorite-project').rightclick();
39 cy.contains('Add to public favorites').click();
40 cy.contains('Public Favorites').click();
41 cy.get('main').contains('my-favorite-project').rightclick();
42 cy.contains('Remove from public favorites').click();
43 cy.get('main').contains('my-favorite-project').should('not.exist');
44 cy.trashGroup(adminUser.token, this.myFavoriteProject.uuid);