Cypress/E2E: Upgrade cypress and test server config (#24594)

* upgrade cypress and test server config

* fix checks to lint and types

* fix CloudSettings and upgrade packages to latest

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Saturnino Abril
2023-10-03 22:26:37 +08:00
коммит произвёл GitHub
родитель 43cb6fa6c1
Коммит f3f9a84456
15 изменённых файлов: 2347 добавлений и 1544 удалений

Просмотреть файл

@@ -10,116 +10,6 @@
// Stage: @prod
// Group: @channels @cloud_only @cloud_trial
function simulateSubscription() {
cy.intercept('GET', '**/api/v4/cloud/subscription/invoices', {
statusCode: 200,
body: [
{
id: 'in_1Lz8b0I67GP2qpb43kcuMyFP',
number: '8D53267B-0006',
create_at: 1667263490000,
total: 65,
tax: 0,
status: 'open',
description: '',
period_start: 1664582400000,
period_end: 1667260800000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUYiI67GP2qpb48DXFukcJ',
total: 65,
quantity: 0.06451612903225806,
price_per_unit: 1000,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
{
id: 'in_1LntnKI67GP2qpb4VObu3NgP',
number: '8D53267B-0005',
create_at: 1664584986000,
total: 733,
tax: 0,
status: 'failed',
description: '',
period_start: 1661990400000,
period_end: 1664582400000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUZ2I67GP2qpb45uTS89eb',
total: 733,
quantity: 0.7333333333333333,
price_per_unit: 999,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
{
id: 'in_1LntnKI67GP2qpb4VObu3NgV',
number: '8D53267B-0005',
create_at: 1664584986000,
total: 733,
tax: 0,
status: 'paid',
description: '',
period_start: 1661990400000,
period_end: 1664582400000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUZ2I67GP2qpb45uTS89eb',
total: 733,
quantity: 0.7333333333333333,
price_per_unit: 999,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
],
});
cy.intercept('GET', '**/api/v4/cloud/subscription', {
statusCode: 200,
body: {
id: 'sub_test1',
is_free_trial: 'true',
customer_id: '5zqhakmibpgyix9juiwwkpfnmr',
product_id: 'prod_K0AxuWCDoDD9Qq',
seats: 25,
status: 'active',
},
});
cy.intercept('GET', '**/api/v4/cloud/products**', {
statusCode: 200,
body:
[
{
id: 'prod_LSBESgGXq9KlLj',
sku: 'cloud-starter',
price_per_seat: 0,
name: 'Cloud Free',
},
{
id: 'prod_K0AxuWCDoDD9Qq',
sku: 'cloud-professional',
price_per_seat: 10,
name: 'Cloud Professional',
},
{
id: 'prod_Jh6tBLcgWWOOog',
sku: 'cloud-enterprise',
price_per_seat: 30,
name: 'Cloud Enterprise',
},
],
});
}
describe('System Console - Billing History', () => {
before(() => {
simulateSubscription();
@@ -166,6 +56,116 @@ describe('System Console - Billing History', () => {
cy.get('@tableRows').eq(1).find('td').eq(4).find('a').should('have.attr', 'href').and('include', 'invoices/in_1LntnKI67GP2qpb4VObu3NgP/pdf');
cy.get('@tableRows').eq(2).find('td').eq(4).find('a').should('have.attr', 'href').and('include', 'invoices/in_1LntnKI67GP2qpb4VObu3NgV/pdf');
});
function simulateSubscription() {
cy.intercept('GET', '**/api/v4/cloud/subscription/invoices', {
statusCode: 200,
body: [
{
id: 'in_1Lz8b0I67GP2qpb43kcuMyFP',
number: '8D53267B-0006',
create_at: 1667263490000,
total: 65,
tax: 0,
status: 'open',
description: '',
period_start: 1664582400000,
period_end: 1667260800000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUYiI67GP2qpb48DXFukcJ',
total: 65,
quantity: 0.06451612903225806,
price_per_unit: 1000,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
{
id: 'in_1LntnKI67GP2qpb4VObu3NgP',
number: '8D53267B-0005',
create_at: 1664584986000,
total: 733,
tax: 0,
status: 'failed',
description: '',
period_start: 1661990400000,
period_end: 1664582400000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUZ2I67GP2qpb45uTS89eb',
total: 733,
quantity: 0.7333333333333333,
price_per_unit: 999,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
{
id: 'in_1LntnKI67GP2qpb4VObu3NgV',
number: '8D53267B-0005',
create_at: 1664584986000,
total: 733,
tax: 0,
status: 'paid',
description: '',
period_start: 1661990400000,
period_end: 1664582400000,
subscription_id: 'sub_K0AxuWCDoDD9Qq',
line_items: [
{
price_id: 'price_1KLUZ2I67GP2qpb45uTS89eb',
total: 733,
quantity: 0.7333333333333333,
price_per_unit: 999,
description: 'Cloud Professional',
},
],
current_product_name: 'Cloud Professional',
},
],
});
cy.intercept('GET', '**/api/v4/cloud/subscription', {
statusCode: 200,
body: {
id: 'sub_test1',
is_free_trial: 'true',
customer_id: '5zqhakmibpgyix9juiwwkpfnmr',
product_id: 'prod_K0AxuWCDoDD9Qq',
seats: 25,
status: 'active',
},
});
cy.intercept('GET', '**/api/v4/cloud/products**', {
statusCode: 200,
body:
[
{
id: 'prod_LSBESgGXq9KlLj',
sku: 'cloud-starter',
price_per_seat: 0,
name: 'Cloud Free',
},
{
id: 'prod_K0AxuWCDoDD9Qq',
sku: 'cloud-professional',
price_per_seat: 10,
name: 'Cloud Professional',
},
{
id: 'prod_Jh6tBLcgWWOOog',
sku: 'cloud-enterprise',
price_per_seat: 30,
name: 'Cloud Enterprise',
},
],
});
}
});
describe('System Console - Empty Billing Screen', () => {

Просмотреть файл

@@ -10,45 +10,6 @@
// Stage: @prod
// Group: @channels @cloud_only @cloud_trial
function simulateSubscription() {
cy.intercept('GET', '**/api/v4/cloud/subscription', {
statusCode: 200,
body: {
id: 'sub_test1',
is_free_trial: 'true',
customer_id: '5zqhakmibpgyix9juiwwkpfnmr',
product_id: 'prod_Jh6tBLcgWWOOog',
seats: 25,
status: 'active',
},
});
cy.intercept('GET', '**/api/v4/cloud/products**', {
statusCode: 200,
body:
[
{
id: 'prod_LSBESgGXq9KlLj',
sku: 'cloud-starter',
price_per_seat: 0,
name: 'Cloud Free',
},
{
id: 'prod_K0AxuWCDoDD9Qq',
sku: 'cloud-professional',
price_per_seat: 10,
name: 'Cloud Professional',
},
{
id: 'prod_Jh6tBLcgWWOOog',
sku: 'cloud-enterprise',
price_per_seat: 30,
name: 'Cloud Enterprise',
},
],
});
}
describe('System Console - Payment Information section', () => {
before(() => {
// * Check if server has license for Cloud
@@ -116,5 +77,43 @@ describe('System Console - Payment Information section', () => {
cy.get('span.savedFeedback__text').should('be.visible').should('have.text', 'Thanks for sharing feedback!');
cy.get('button#feedbackSubmitedDone').should('be.enabled').click();
});
});
function simulateSubscription() {
cy.intercept('GET', '**/api/v4/cloud/subscription', {
statusCode: 200,
body: {
id: 'sub_test1',
is_free_trial: 'true',
customer_id: '5zqhakmibpgyix9juiwwkpfnmr',
product_id: 'prod_Jh6tBLcgWWOOog',
seats: 25,
status: 'active',
},
});
cy.intercept('GET', '**/api/v4/cloud/products**', {
statusCode: 200,
body:
[
{
id: 'prod_LSBESgGXq9KlLj',
sku: 'cloud-starter',
price_per_seat: 0,
name: 'Cloud Free',
},
{
id: 'prod_K0AxuWCDoDD9Qq',
sku: 'cloud-professional',
price_per_seat: 10,
name: 'Cloud Professional',
},
{
id: 'prod_Jh6tBLcgWWOOog',
sku: 'cloud-enterprise',
price_per_seat: 30,
name: 'Cloud Enterprise',
},
],
});
}
});