n8n/cypress/e2e/27-cloud.cy.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.7 KiB
TypeScript
Raw Normal View History

import planData from '../fixtures/Plan_data_opt_in_trial.json';
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
import {
BannerStack,
MainSidebar,
WorkflowPage,
visitPublicApiPage,
getPublicApiUpgradeCTA,
} from '../pages';
const mainSidebar = new MainSidebar();
const bannerStack = new BannerStack();
const workflowPage = new WorkflowPage();
describe('Cloud', () => {
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
before(() => {
const now = new Date();
const fiveDaysFromNow = new Date(now.getTime() + 5 * 24 * 60 * 60 * 1000);
planData.expirationDate = fiveDaysFromNow.toJSON();
});
beforeEach(() => {
cy.overrideSettings({
deployment: { type: 'cloud' },
n8nMetadata: { userId: '1' },
});
cy.intercept('GET', '/rest/admin/cloud-plan', planData).as('getPlanData');
cy.intercept('GET', '/rest/cloud/proxy/user/me', {}).as('getCloudUserInfo');
cy.intercept('GET', new RegExp('/rest/projects*')).as('projects');
cy.intercept('GET', new RegExp('/rest/roles')).as('roles');
});
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
function visitWorkflowPage() {
cy.visit(workflowPage.url);
cy.wait('@getPlanData');
cy.wait('@projects');
cy.wait('@roles');
}
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
describe('BannerStack', () => {
it('should render trial banner for opt-in cloud user', () => {
visitWorkflowPage();
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
bannerStack.getters.banner().should('be.visible');
mainSidebar.actions.signout();
bannerStack.getters.banner().should('not.be.visible');
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
});
});
describe('Admin Home', () => {
it('Should show admin button', () => {
visitWorkflowPage();
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
mainSidebar.getters.adminPanel().should('be.visible');
});
});
describe('Public API', () => {
it('Should show upgrade CTA for Public API if user is trialing', () => {
visitPublicApiPage();
cy.wait(['@loadSettings', '@projects', '@roles', '@getPlanData']);
fix: Show public API upgrade CTA when feature is not enabled (#8109) ## Summary > Describe what the PR does and how to test. Photos and videos are recommended. Shows the public API upgrade CTA when the feature is not enabled. Now trialing users in cloud would see the API on the settings menu and can upgrade from there. When public API feature disabled: <img width="1863" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a9052f6b-151f-4ebb-80df-5ff2fa643e85"> When public API feature enabled with no API key: <img width="1861" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/fdfe7296-425e-4410-a8cb-f25535bc9df4"> When public API feature enabled with API key: <img width="1423" alt="image" src="https://github.com/n8n-io/n8n/assets/16496553/a8426cbf-ff73-43c4-8c60-b00274bca46e"> ## Related tickets and issues [> Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to r](https://linear.app/n8n/issue/ADO-1282/feature-api-page-missing-for-trial-users)eviewers. ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [x] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. > A feature is not complete without tests.
2023-12-21 06:06:54 -08:00
getPublicApiUpgradeCTA().should('be.visible');
});
});
});