Skip to content

Commit

Permalink
fix: backup create cluster
Browse files Browse the repository at this point in the history
Signed-off-by: liuying <liu.ying@99cloud.net>
  • Loading branch information
lysign committed Mar 9, 2023
1 parent 86e5dc9 commit e450b7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/pages/cluster/backup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const clusterName = `e2e.cluster.name.${uuid}`;

before(() => {
cy.login();
cy.createClusterQuick(clusterName);
cy.createClusterQuick(clusterName, 'last');
});

after(() => {
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ Cypress.Commands.add('login', (visitUrl = '') => {
.loginFormSubmit();
// cy.visitPage(visitUrl || '/cluster', isTable);
// cy.visit(visitUrl || '/cluster');
cy.screenshot();
cy.wait(2000);
visitUrl && cy.visit(visitUrl);
cy.screenshot();

cy.wait(2000);
});

Expand Down
6 changes: 4 additions & 2 deletions cypress/support/form-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import getTitle from './common';
import { isArray } from 'lodash';
import { isArray, isString } from 'lodash';

function getId(formItemName) {
return `#form-item-col-${formItemName}`;
Expand Down Expand Up @@ -247,7 +247,9 @@ Cypress.Commands.add(
.find('.ant-checkbox-wrapper')
.as('leftCheckbox');

if (!leftIndex) {
if (isString(leftIndex)) {
cy.get('@leftCheckbox').last().click();
} else if (!leftIndex) {
cy.get('@leftCheckbox').first().click();
} else if (isArray(leftIndex)) {
leftIndex.forEach((index) => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

// 快速创建集群
Cypress.Commands.add('createClusterQuick', (clusterName) => {
Cypress.Commands.add('createClusterQuick', (clusterName, nodeIndex) => {
cy.visitPage('/cluster');

cy.clickHeaderButton(0);
Expand All @@ -28,7 +28,7 @@ Cypress.Commands.add('createClusterQuick', (clusterName) => {
cy.formSelect('region', 'default');
// select node
cy.waitTransferList();
cy.formMultiTransfer('nodes', 0);
cy.formMultiTransfer('nodes', nodeIndex);

// next step
cy.clickStepActionNextButton('step-next');
Expand Down

0 comments on commit e450b7d

Please sign in to comment.