WIP: e2e fix

This commit is contained in:
r00gm 2024-11-13 16:21:49 +01:00
parent 8f321a98b4
commit 14c3d7a76f
No known key found for this signature in database
6 changed files with 48 additions and 7 deletions

View file

@ -6,8 +6,17 @@ const credentialsModal = new CredentialsModal();
export const getHomeButton = () => cy.getByTestId('project-home-menu-item');
export const getMenuItems = () => cy.getByTestId('project-menu-item');
export const getAddProjectButton = () =>
cy.getByTestId('add-project-menu-item').should('contain', 'Add project').should('be.visible');
export const getAddProjectButton = () => {
cy.getByTestId('universal-add').should('be.visible').click();
return cy
.getByTestId('navigation-menu-item')
.should('be.visible')
.filter(':contains("Project")')
.last();
};
// export const getAddProjectButton = () =>
// cy.getByTestId('universal-add').should('contain', 'Add project').should('be.visible');
export const getProjectTabs = () => cy.getByTestId('project-tabs').find('a');
export const getProjectTabWorkflows = () => getProjectTabs().filter('a[href$="/workflows"]');
export const getProjectTabCredentials = () => getProjectTabs().filter('a[href$="/credentials"]');

View file

@ -275,7 +275,7 @@ describe('Projects', { disableAutoLogin: true }, () => {
cy.changeQuota('maxTeamProjects', -1);
});
it('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
it.only('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
cy.signinAsOwner();
cy.visit(workflowsPage.url);

View file

@ -5,7 +5,24 @@ export class CredentialsPage extends BasePage {
getters = {
emptyListCreateCredentialButton: () => cy.getByTestId('empty-resources-list').find('button'),
createCredentialButton: () => cy.getByTestId('resources-list-add'),
createCredentialButton: () => {
cy.getByTestId('resource-add').should('be.visible').click();
cy.getByTestId('navigation-submenu')
.should('be.visible')
.filter(':contains("Credential")')
.last()
.click();
return cy
.getByTestId('navigation-submenu-item')
.should('be.visible')
.filter(':contains("Personal")')
.last();
},
// cy.getByTestId('resources-list-add'),
searchInput: () => cy.getByTestId('resources-list-search'),
emptyList: () => cy.getByTestId('resources-list-empty'),
credentialCards: () => cy.getByTestId('resources-list-item'),

View file

@ -7,7 +7,22 @@ export class WorkflowsPage extends BasePage {
newWorkflowButtonCard: () => cy.getByTestId('new-workflow-card'),
newWorkflowTemplateCard: () => cy.getByTestId('new-workflow-template-card'),
searchBar: () => cy.getByTestId('resources-list-search'),
createWorkflowButton: () => cy.getByTestId('resources-list-add'),
createWorkflowButton: () => {
cy.getByTestId('resource-add').should('be.visible').click();
cy.getByTestId('navigation-submenu')
.should('be.visible')
.filter(':contains("Workflow")')
.last()
.click();
return cy
.getByTestId('navigation-submenu-item')
.should('be.visible')
.filter(':contains("Personal")')
.first();
},
workflowCards: () => cy.getByTestId('resources-list-item'),
workflowCard: (workflowName: string) =>
this.getters

View file

@ -314,7 +314,7 @@ const { menu, handleSelect: handleMenuSelect } = useGlobalEntityCreation();
<template #header>
<div :class="$style.logo">
<img :src="logoPath" data-test-id="n8n-logo" :class="$style.icon" alt="n8n" />
<N8nNavigationDropdown :menu @select="handleMenuSelect">
<N8nNavigationDropdown data-test-id="universal-add" :menu @select="handleMenuSelect">
<N8nIconButton icon="plus" type="secondary" outline />
</N8nNavigationDropdown>
</div>

View file

@ -73,7 +73,7 @@ const createLabel = computed(() => {
</div>
<div :class="$style.actions">
<ProjectTabs :show-settings="showSettings" />
<N8nNavigationDropdown :menu @select="handleSelect">
<N8nNavigationDropdown data-test-id="resource-add" :menu @select="handleSelect">
<N8nIconButton :label="createLabel" icon="plus" style="width: auto" />
</N8nNavigationDropdown>
</div>