Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add page reload judgment #2370

Merged
merged 14 commits into from
May 6, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ context('Table Auto Jump When No Data', () => {
deleteConsumerSuccess: 'Delete Consumer Successfully',
};

beforeEach(() => {
before(() => {
cy.login();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cy.login();
cy.login().then( () => { cy.requestWithToken({ method: 'PUT', payload, url: '/apisix/admin/consumers' });
});

Array.from({ length: 11 }).forEach((value, key) => {
const payload = {
Expand All @@ -59,12 +59,12 @@ context('Table Auto Jump When No Data', () => {
cy.contains('Consumer').click();
cy.get(selector.page_item).click();
cy.wait(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wait for 1 s?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oil-oil ping

cy.contains('Delete').click({ force: true });
cy.contains('Delete').click();
cy.get(selector.popoper)
.not(selector.popoprerHiden)
.contains('Confirm')
.should('be.visible')
.click({ force: true });
.click();
cy.get(selector.notification).should('contain', data.deleteConsumerSuccess);
cy.get(selector.notificationCloseIcon).click();
cy.url().should('contains', '/consumer/list?page=1&pageSize=10');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ context('Batch Create Proto And Delete Proto', () => {
deleteProtoSuccess: 'Delete proto Successfully',
};

beforeEach(() => {
before(() => {
cy.login();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Array.from({ length: 11 }).forEach(async (value, key) => {
const payload = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ context('Table Auto Jump When No Data', () => {
deleteRouteSuccess: 'Delete Route Successfully',
};

beforeEach(() => {
before(() => {
cy.login();
Array.from({ length: 11 }).forEach((value, key) => {
const payload = {
Expand Down Expand Up @@ -75,7 +75,7 @@ context('Table Auto Jump When No Data', () => {
cy.get(selector.deleteAlert)
.should('be.visible')
.within(() => {
cy.contains('OK').click({ force: true });
cy.contains('OK').click();
});
cy.get(selector.notification).should('contain', data.deleteRouteSuccess);
cy.get(selector.notificationCloseIcon).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ context('Table Auto Jump When No Data', () => {
size: 320,
idle_timeout: 60,
requests: 1000,
ß,
},
nodes: {
'127.0.0.1': 1,
Expand Down