.should('contain', '3').and('contain', '3 B');
// Check context menus on version browser
+ cy.waitForDom();
cy.get('[data-cy=collection-version-browser-select-3]').rightclick()
cy.get('[data-cy=context-menu]')
.should('contain', 'Add to favorites')
cy.waitForDom().get('.layout-pane-primary', { timeout: 12000 }).contains('Projects').click();
- cy.get('main').contains(`Files extracted from: ${this.collection.name}`).click();
+ cy.waitForDom().get('main').contains(`Files extracted from: ${this.collection.name}`).click();
cy.get('[data-cy=collection-files-panel]')
.and('contain', 'bar');
});
cy.get('[data-cy=context-menu]').contains('Copy to clipboard').click();
cy.window().then((win) => (
win.navigator.clipboard.readText().then((text) => {
- expect(text).to.match(/https\:\/\/localhost\:[0-9]+\/projects\/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/,);
+ expect(text).to.match(/https\:\/\/127\.0\.0\.1\:[0-9]+\/projects\/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/,);
})
));
});
it('shows search context menu', function() {
- const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
- const federatedColName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const colName = `Home Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const federatedColName = `Federated Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
const federatedColUuid = "xxxxx-4zz18-000000000000000";
// Intercept config to insert remote cluster
- cy.intercept({method: 'GET', hostname: 'localhost', url: '**/arvados/v1/config?nocache=*'}, (req) => {
+ cy.intercept({method: 'GET', hostname: '127.0.0.1', url: '**/arvados/v1/config?nocache=*'}, (req) => {
req.reply((res) => {
res.body.RemoteClusters = {
"*": res.body.RemoteClusters["*"],
cy.contains('View details');
cy.contains('Copy to clipboard').click();
+ cy.waitForDom();
cy.window().then((win) => (
win.navigator.clipboard.readText().then((text) => {
expect(text).to.match(new RegExp(`/collections/${testCollection.uuid}$`));
cy.get('[data-cy=search-results]').contains(colName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Open in new tab').click();
+ cy.waitForDom();
cy.get('@Open').should('have.been.calledOnceWith', `${window.location.origin}/collections/${testCollection.uuid}`)
});
cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Copy to clipboard').click();
+ cy.waitForDom();
cy.window().then((win) => (
win.navigator.clipboard.readText().then((text) => {
expect(text).to.equal(`https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`);
cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
cy.get('[data-cy=context-menu]').within(() => {
cy.contains('Open in new tab').click();
+ cy.waitForDom();
cy.get('@Open').should('have.been.calledWith', `https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`)
});
{url: '/all_processes', label: 'All Processes'},
{url: '/trash', label: 'Trash'},
].map(function(section) {
- cy.goToPath(section.url);
+ cy.waitForDom().goToPath(section.url);
cy.get('[data-cy=breadcrumb-first]')
.should('contain', section.label);
cy.get('[data-cy=side-panel-button]')
cy.get('input').type('VMAdmin');
})
});
- cy.get('[role=tooltip]').click();
+ cy.waitForDom().get('[role=tooltip]').click();
cy.get('[data-cy=form-dialog]').as('add-login-dialog')
.should('contain', 'Add login permission')
.within(() => {
cy.get('@removeButton').click();
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
- cy.get('[data-cy=vm-admin-table]')
+ cy.waitForDom().get('[data-cy=vm-admin-table]')
.contains(vmHost)
.parents('tr')
.within(() => {
- cy.get('div[role=button]').should('not.contain', 'admin');
+ cy.get('div[role=button]').should('not.exist');
});
// Check admin's vm page for login
import { RootState } from 'store/store';
import { getUserUuid } from "common/getuser";
import { getResource } from 'store/resources/resources';
-import { TreePicker } from '../tree-picker/tree-picker';
-import { getSidePanelTreeBranch, getSidePanelTreeNodeAncestorsIds } from '../side-panel-tree/side-panel-tree-actions';
import { propertiesActions } from '../properties/properties-actions';
import { getProcess } from 'store/processes/process';
import { ServiceRepository } from 'services/services';
icon: resourceToBreadcrumbIcon(resource),
})
-const getSidePanelTreeBreadcrumbs = (uuid: string) => (treePicker: TreePicker): Breadcrumb[] => {
- const nodes = getSidePanelTreeBranch(uuid)(treePicker);
- return nodes.map(node =>
- typeof node.value === 'string'
- ? {
- label: node.value,
- uuid: node.id,
- icon: getSidePanelIcon(node.value)
- }
- : resourceToBreadcrumb(node.value));
-};
-
export const setSidePanelBreadcrumbs = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const { treePicker, collectionPanel: { item } } = getState();
- const breadcrumbs = getSidePanelTreeBreadcrumbs(uuid)(treePicker);
+ const ancestors = await services.ancestorsService.ancestors(uuid, '');
+ dispatch(updateResources(ancestors));
+
+ let breadcrumbs: Breadcrumb[] = [];
+ const { collectionPanel: { item } } = getState();
+
const path = getState().router.location!.pathname;
const currentUuid = path.split('/')[2];
const uuidKind = extractUuidKind(currentUuid);
+ const rootUuid = getUserUuid(getState());
+
+ if (ancestors.find(ancestor => ancestor.uuid === rootUuid)) {
+ // Handle home project uuid root
+ breadcrumbs.push({
+ label: SidePanelTreeCategory.PROJECTS,
+ uuid: SidePanelTreeCategory.PROJECTS,
+ icon: getSidePanelIcon(SidePanelTreeCategory.PROJECTS)
+ });
+ } else if (Object.values(SidePanelTreeCategory).includes(uuid as SidePanelTreeCategory)) {
+ // Handle SidePanelTreeCategory root
+ breadcrumbs.push({
+ label: uuid,
+ uuid: uuid,
+ icon: getSidePanelIcon(uuid)
+ });
+ }
+
+ breadcrumbs = ancestors.reduce((breadcrumbs, ancestor) =>
+ ancestor.kind === ResourceKind.GROUP
+ ? [...breadcrumbs, resourceToBreadcrumb(ancestor)]
+ : breadcrumbs,
+ breadcrumbs);
if (uuidKind === ResourceKind.COLLECTION) {
const collectionItem = item ? item : await services.collectionService.get(currentUuid);
export const setProjectBreadcrumbs = (uuid: string) =>
- (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
- const ancestors = getSidePanelTreeNodeAncestorsIds(uuid)(getState().treePicker);
+ async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const ancestors = await services.ancestorsService.ancestors(uuid, '');
const rootUuid = getUserUuid(getState());
- if (uuid === rootUuid || ancestors.find(uuid => uuid === rootUuid)) {
+ if (uuid === rootUuid || ancestors.find(ancestor => ancestor.uuid === rootUuid)) {
dispatch(setSidePanelBreadcrumbs(uuid));
} else {
dispatch(setSharedWithMeBreadcrumbs(uuid));
# Wait for workbench2 to be up.
# Using https-get to avoid false positive 'ready' detection.
-yarn run wait-on --timeout 300000 https-get://localhost:${WB2_PORT} || exit 1
+yarn run wait-on --timeout 300000 https-get://127.0.0.1:${WB2_PORT} || exit 1
echo "Running tests..."
CYPRESS_system_token=systemusertesttoken1234567890aoeuidhtnsqjkxbmwvzpy \
CYPRESS_controller_url=${controllerURL} \
- CYPRESS_BASE_URL=https://localhost:${WB2_PORT} \
+ CYPRESS_BASE_URL=https://127.0.0.1:${WB2_PORT} \
yarn run cypress ${CYPRESS_MODE}