fix(editor): Trial banner does not disappear after sign out (no-changelog) (#6930)

to test in staging use version
`PR-6930-ado-990-trial-banner-does-not-disappear-after-sign-out`

<img width="875" alt="image"
src="https://github.com/n8n-io/n8n/assets/16496553/dfffe60f-bec3-4c48-bd9c-5990c68afa52">
This commit is contained in:
Ricardo Espinoza
2023-08-17 07:57:40 -04:00
committed by GitHub
parent ad15d3eae9
commit d3f01270c7
10 changed files with 181 additions and 37 deletions

View File

@@ -0,0 +1,8 @@
import { BasePage } from './base';
export class BannerStack extends BasePage {
getters = {
banner: () => cy.getByTestId('banner-stack'),
};
actions = {};
}

View File

@@ -7,3 +7,4 @@ export * from './settings-users';
export * from './settings-log-streaming';
export * from './sidebar';
export * from './ndv';
export * from './bannerStack';

View File

@@ -1,4 +1,5 @@
import { BasePage } from '../base';
import { WorkflowsPage } from '../workflows';
export class MainSidebar extends BasePage {
getters = {
@@ -9,7 +10,7 @@ export class MainSidebar extends BasePage {
workflows: () => this.getters.menuItem('Workflows'),
credentials: () => this.getters.menuItem('Credentials'),
executions: () => this.getters.menuItem('Executions'),
userMenu: () => cy.getByTestId('main-sidebar-user-menu'),
userMenu: () => cy.get('div[class="action-dropdown-container"]'),
};
actions = {
goToSettings: () => {
@@ -26,5 +27,15 @@ export class MainSidebar extends BasePage {
openUserMenu: () => {
this.getters.userMenu().find('[role="button"]').last().click();
},
openUserMenu: () => {
this.getters.userMenu().click();
},
signout: () => {
const workflowsPage = new WorkflowsPage();
cy.visit(workflowsPage.url);
this.actions.openUserMenu();
cy.getByTestId('user-menu-item-logout').click();
cy.wrap(Cypress.session.clearAllSavedSessions());
},
};
}