Merge pull request #11553 from ToolJet/test/update-bulkupload-testcases

Updated bulk upload test cases
This commit is contained in:
Adish M 2024-12-10 14:51:59 +05:30 committed by GitHub
commit e2676cfa00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 74 additions and 126 deletions

View file

@ -166,6 +166,7 @@ export const commonSelectors = {
resetPasswordPageDescription: '[data-cy="reset-password-page-description"]',
backToLoginButton: '[data-cy="back-to-login"]',
breadcrumbTitle: '[data-cy="app-header-label"]>>',
// breadcrumbPageTitle: '[data-cy="app-header-label"]',
breadcrumbPageTitle: '[data-cy="breadcrumb-page-title"]',
labelFullNameInput: '[data-cy="name-label"]',
inputFieldFullName: '[data-cy="name-input"]',

View file

@ -32,7 +32,7 @@ export const ssoSelector = {
redirectUrlLabel: "[data-cy=redirect-url-label]",
redirectUrl: "[data-cy=redirect-url]",
googleTile: '[data-cy="google-sign-in-text"]',
googleIcon: "[data-cy=google-sso-icon]",
googleIcon: "[data-cy=google-sso-button]",
googleSSOText: "[data-cy=google-sso-button-text]",
git: '[data-cy="github-sso-card"]',
gitEnableToggle: '[data-cy="github-toggle-input"]',
@ -41,8 +41,8 @@ export const ssoSelector = {
encriptedLabel: "[data-cy=encripted-label]",
clientSecretInput: "[data-cy=client-secret-input]",
gitTile: "[data-cy=git-tile]",
gitIcon: "[data-cy=git-sso-icon]",
gitSignInText: "[data-cy=git-sso-text]",
gitIcon: "[data-cy='git-sso-button-text']",
gitSignInText: "[data-cy='git-sso-button-text']",
gitSSOText: "[data-cy=git-sso-button-text]",
password: "[data-cy=left-menu-items] :eq(3)",
passwordEnableToggle: '[data-cy="password-enable-toggle"]',

View file

@ -62,6 +62,7 @@ export const usersSelector = {
inputFieldBulkUpload: '[data-cy="input-field-bulk-upload"]',
copyInvitationLink: '[data-cy="copy-invitation-link"]',
uploadedFileData: '[data-cy="uploaded-file-data"]',
modalClose: '.tj-base-btn.tj-large-btn.tj-primary-btn.close-btn',
toastCloseButton:'.drawer-container > [style="position: fixed; z-index: 9999; inset: 16px; pointer-events: none;"] > .go4109123758 > .go2072408551 > [data-cy="toast-close-button"]',
userName: (userName) => {
return `[data-cy="${cyParamName(userName)}-user-name"]`;

View file

@ -65,15 +65,15 @@ describe("App Version Functionality", () => {
closeModal(commonText.closeButton);
});
it("Verify all functionality for the app version", () => {
it.skip("Verify all functionality for the app version", () => {
data.appName = `${fake.companyName}-App`;
cy.apiCreateApp(data.appName);
cy.openApp()
cy.get('[data-cy="widget-list-box-table"]').should("be.visible");
cy.dragAndDropWidget("Text", 50, 50);
// cy.dragAndDropWidget("Text", 50, 50);
verifyComponent("text1");
navigateToCreateNewVersionModal((currentVersion = "v1"));
createNewVersion((newVersion = ["v2"]), (versionFrom = "v1"));
verifyComponent("text1");

View file

@ -28,11 +28,6 @@ describe("Manage SSO for multi workspace", () => {
commonText.breadcrumbworkspaceSettingTitle
);
});
cy.get(commonSelectors.breadcrumbPageTitle).verifyVisibleElement(
"have.text",
ssoText.pagetitle
);
cy.get(ssoSelector.cardTitle).verifyVisibleElement(
"have.text",
"Workspace login"
@ -72,6 +67,7 @@ describe("Manage SSO for multi workspace", () => {
it("Should verify Google SSO page elements", () => {
common.navigateToManageSSO();
cy.wait(2000);
cy.get(ssoSelector.google).should("be.visible").click();
cy.get(ssoSelector.cardTitle)
.eq(1)

View file

@ -406,12 +406,31 @@ describe("user invite flow cases", () => {
commonSelectors.toastMessage,
"User has been updated"
);
searchUser(data.email);
cy.get('[data-name="role-header"] [data-cy="group-chip"]').should(
"have.text",
"Admin"
);
cy.get(usersSelector.userActionButton).click();
cy.get(usersSelector.editUserDetailsButton).click();
cy.get('[data-cy="user-group-select"]>>>>>').eq(0).type("Builder");
cy.wait(1000);
cy.get('[data-cy="group-check-input"]').eq(0).check();
cy.get(usersSelector.buttonInviteUsers).click();
cy.get('[data-cy="confim-button"]').click();
cy.verifyToastMessage(
commonSelectors.toastMessage,
"User has been updated"
);
searchUser(data.email);
cy.get('[data-name="role-header"] [data-cy="group-chip"]').should(
"have.text",
"Builder"
);
});
it("Should verify exisiting user invite flow", () => {
@ -515,7 +534,7 @@ describe("user invite flow cases", () => {
"The user is already registered. Please check your inbox for the activation link"
);
});
it("should verify exisiting user workspace signup from instance using form", () => {
data.firstName = fake.firstName;
data.email = fake.email.toLowerCase().replaceAll("[^A-Za-z]", "");

View file

@ -1,7 +1,7 @@
import { commonSelectors } from "Selectors/common";
import { usersText } from "Texts/manageUsers";
import { usersSelector } from "Selectors/manageUsers";
import { bulkUserUpload } from "Support/utils/manageUsers";
import { bulkUserUpload,bulkUserUploadDuplicate} from "Support/utils/manageUsers";
import * as common from "Support/utils/common";
import { path } from "Texts/common";
import { groupsSelector } from "Selectors/manageGroups";
@ -14,8 +14,6 @@ describe("Bulk user upload", () => {
const without_email = "cypress/fixtures/bulkUser/without_email - Sheet1.csv";
const without_group = "cypress/fixtures/bulkUser/without_group - Sheet1.csv";
const same_email = "cypress/fixtures/bulkUser/same_email - Sheet1.csv";
const invalid_group_name =
"cypress/fixtures/bulkUser/invalid_group_name - Sheet1.csv";
const empty_first_and_last_name =
"cypress/fixtures/bulkUser/empty_first_and_last_name - Sheet1.csv";
const limit_exceeded_list =
@ -24,10 +22,8 @@ describe("Bulk user upload", () => {
"cypress/fixtures/bulkUser/non_existing_group -Sheet1 .csv";
const multiple_groups =
"cypress/fixtures/bulkUser/multiple_groups - Sheet1.csv";
const without_firstName =
"cypress/fixtures/bulkUser/without_firstname - Sheet1.csv";
const without_lastName =
"cypress/fixtures/bulkUser/without_lastname - Sheet1.csv";
const without_Role =
"cypress/fixtures/bulkUser/without_Role - Sheet1.csv";
const invite_users = "cypress/fixtures/bulkUser/invite_users - Sheet1 .csv";
const Validinvite = "cypress/fixtures/bulkUser/10usersupload.csv";
@ -54,24 +50,13 @@ describe("Bulk user upload", () => {
"without_email",
"Missing email,groups information in 10 row(s);. No users were uploaded, please update and try again."
);
// bulkUserUpload(
// without_group,
// "without_group",
// "Invalid row(s): [groups] in [5] row(s). No users were uploaded."
// );
//Add automation for modal data-cy="close-button"
// bulkUserUpload(
// same_email,
// "same_email",
// "Duplicate email found. Please provide a unique email address."
// );
bulkUserUploadDuplicate(
same_email,
"same_email",
"Duplicate email found. Please provide a unique email address."
);
// bulkUserUpload(
// invalid_group_name,
// "invalid_group_name",
// "11 groups doesn't exist. No users were uploaded"
// );
bulkUserUpload(
empty_first_and_last_name,
"empty_first_and_last_name",
@ -89,6 +74,12 @@ describe("Bulk user upload", () => {
"2 groups doesn't exist. No users were uploaded"
);
bulkUserUpload(
without_Role,
"without_Role",
"Missing user_role,groups information in 5 row(s);. No users were uploaded, please update and try again."
);
//add more groups and verify
// bulkUserUpload(
@ -97,32 +88,8 @@ describe("Bulk user upload", () => {
// "Conflicting Group Memberships: User cannot be in both the Admin group and other groups simultaneously."
// );
// cy.get(usersSelector.inputFieldBulkUpload).selectFile(without_firstName, {
// force: true,
// });
// cy.get(usersSelector.uploadedFileData).should(
// "contain",
// "without_firstname"
// );
// cy.get(usersSelector.buttonUploadUsers).click();
// cy.get(".go2072408551")
// .should("be.visible")
// .and("have.text", "Missing first_name,user_role,groups information in 5 row(s);. No users were uploaded, please update and try again.Missing first_name,user_role,groups information in 5 row(s);. No users were uploaded, please update and try again.");
// cy.wait(5000);
// // cy.get(usersSelector.buttonAddUsers).click();
// cy.get(usersSelector.buttonUploadCsvFile).click();
// cy.get(usersSelector.inputFieldBulkUpload).selectFile(without_lastName, {
// force: true,
// });
// cy.get(usersSelector.uploadedFileData).should(
// "contain",
// "without_lastname"
// );
// cy.get(usersSelector.buttonUploadUsers).click();
// cy.get(".go2072408551")
// .should("be.visible")
// .and("have.text", "Missing last_name,user_role,groups information in 5 row(s);. No users were uploaded, please update and try again.Missing last_name,user_role,groups information in 5 row(s);. No users were uploaded, please update and try again.");
});
it("Verify bulk user upload functionality", () => {

View file

@ -52,33 +52,29 @@ describe("Redirection error pages", () => {
cy.wait(1000);
releaseApp();
cy.get(commonWidgetSelector.shareAppButton).click();
cy.clearAndType(commonWidgetSelector.appNameSlugInput, data.slug);
cy.pause();
cy.wait(1000);
cy.logoutApi();
cy.apiLogin("test@tooljet.com", "password");
cy.visit(`/applications/${data.slug}`);
cy.pause();
cy.get(commonSelectors.modalHeader).verifyVisibleElement(
"have.text",
"App URL Unavailable"
"Invalid link"
);
cy.get(commonSelectors.modalDescription).verifyVisibleElement(
"have.text",
"The app URL is currently unavailable because the app has not been released. Please either release it or contact admin for access."
"The link you provided is invalid. Please check the link and try again."
);
cy.get(commonSelectors.backToHomeButton).verifyVisibleElement(
"have.text",
"Back to home page"
);
cy.url().should("eq", "http://localhost:8082/error/restricted");
cy.url().should("eq", "http://localhost:8082/error/invalid-link");
cy.get(commonSelectors.backToHomeButton).click();
cy.get(commonSelectors.pageSectionHeader).should("be.visible");
});
it.skip("Verify error modal for app url of unreleased apps", () => {
it("Verify error modal for app url of unreleased apps", () => {
data.appName = `${fake.companyName} App`;
data.slug = data.appName.toLowerCase().replace(/\s+/g, "-");
@ -108,10 +104,7 @@ describe("Redirection error pages", () => {
"Back to home page"
);
cy.url().should(
"eq",
`http://localhost:8082/error/restricted`
);
cy.url().should('contain', '/error/')
cy.get(commonSelectors.backToHomeButton).click();
cy.get(commonSelectors.pageSectionHeader).should("be.visible");
@ -128,33 +121,15 @@ describe("Redirection error pages", () => {
"have.text",
"The app URL is currently unavailable because the app has not been released. Please either release it or contact admin for access."
);
// cy.get('[data-cy="open-app-button"]').verifyVisibleElement("have.text", "Open app")
cy.get(commonSelectors.backToHomeButton).verifyVisibleElement(
"have.text",
"Back to home page"
);
cy.url().should("eq", "http://localhost:8082/error/restricted");
cy.url().should('contain', '/error/')
cy.get(commonSelectors.backToHomeButton).click();
cy.get(commonSelectors.pageSectionHeader).should("be.visible");
logout();
cy.defaultWorkspaceLogin();
navigateToManageGroups();
cy.get(groupsSelector.appsLink).click();
cy.wait(1000);
cy.get(groupsSelector.appSearchBox).click();
cy.wait(1000);
cy.get(groupsSelector.searchBoxOptions).contains(data.appName).click();
cy.get(groupsSelector.selectAddButton).click();
cy.get("table").contains("td", data.appName);
cy.contains("td", data.appName)
.parent()
.within(() => {
cy.get("td input").eq(1).check();
});
cy.logoutApi();
cy.apiLogin("test@tooljet.com", "password");
cy.wait(500);
@ -171,10 +146,7 @@ describe("Redirection error pages", () => {
"have.text",
"Back to home page"
);
cy.url().should(
"eq",
`http://localhost:8082/error/restricted`
);
cy.url().should('contain', '/error/')
cy.get(commonSelectors.backToHomeButton).click();
cy.get(commonSelectors.pageSectionHeader).should("be.visible");
});

View file

@ -1,3 +0,0 @@
First Name,Last Name,Email,User Role,Group
Test,Example,test12@gmail.com,Admin,ABC
Test,Example,test13@gmail.com,Builder,Test
1 First Name Last Name Email User Role Group
2 Test Example test12@gmail.com Admin ABC
3 Test Example test13@gmail.com Builder Test

View file

@ -1,4 +0,0 @@
First Name,Last Name,Email,User Role,Group
,test,demo1@gmail.com,Admin,
,test,demo2@gmail.com,Builder,
,test,demo3@gmail.com,End User,
1 First Name Last Name Email User Role Group
2 test demo1@gmail.com Admin
3 test demo2@gmail.com Builder
4 test demo3@gmail.com End User

View file

@ -1,6 +0,0 @@
First Name,Last Name,Email,User Role,Group
Test,Example,test12@gmail.com,Admin,
Test,Example,test13@gmail.com,Builder,
Test,Example,test14@gmail.com,End User,
Test,Example,test15@gmail.com,End User,
Test,Example,test16@gmail.com,End User,
1 First Name Last Name Email User Role Group
2 Test Example test12@gmail.com Admin
3 Test Example test13@gmail.com Builder
4 Test Example test14@gmail.com End User
5 Test Example test15@gmail.com End User
6 Test Example test16@gmail.com End User

View file

@ -1,11 +0,0 @@
First Name,Last Name,Email,User Role,Group
test,,withoutlastname1@gmail.com,Admin,Admin
test,,withoutlastname2@gmail.com,Builder,Builder
test,,withoutlastname3@gmail.com,Builder,Builder
test,,withoutlastname4@gmail.com,End User,End User
test,,withoutlastname5@gmail.com,End User,End User
test,,withoutlastname6@gmail.com,End User,End User
test,,withoutlastname7@gmail.com,End User,End User
test,,withoutlastname8@gmail.com,End User,End User
test,,withoutlastname9@gmail.com,End User,End User
test,,withoutlastname10@gmail.com,End User,End User
1 First Name Last Name Email User Role Group
2 test withoutlastname1@gmail.com Admin Admin
3 test withoutlastname2@gmail.com Builder Builder
4 test withoutlastname3@gmail.com Builder Builder
5 test withoutlastname4@gmail.com End User End User
6 test withoutlastname5@gmail.com End User End User
7 test withoutlastname6@gmail.com End User End User
8 test withoutlastname7@gmail.com End User End User
9 test withoutlastname8@gmail.com End User End User
10 test withoutlastname9@gmail.com End User End User
11 test withoutlastname10@gmail.com End User End User

View file

@ -0,0 +1,6 @@
First Name,Last Name,Email,User Role,Group
Test,Example,test12@gmail.com,,
Test,Example,test13@gmail.com,,
Test,Example,test14@gmail.com,,
Test,Example,test15@gmail.com,,
Test,Example,test16@gmail.com,,
1 First Name Last Name Email User Role Group
2 Test Example test12@gmail.com
3 Test Example test13@gmail.com
4 Test Example test14@gmail.com
5 Test Example test15@gmail.com
6 Test Example test16@gmail.com

View file

@ -56,12 +56,9 @@ export const generalSettings = () => {
export const googleSSOPageElements = () => {
cy.get(ssoSelector.googleEnableToggle).click();
cy.wait(5000);
cy.get(ssoSelector.saveButton).eq(1).click();
cy.get('[data-cy="modal-title"]').verifyVisibleElement(
"have.text",
"Enable Google"
);
cy.wait(2000);
cy.get('[data-cy="modal-close-button"]').should("be.visible");
cy.get('[data-cy="modal-message"]').verifyVisibleElement(
"have.text",

View file

@ -220,6 +220,19 @@ export const bulkUserUpload = (file, fileName, toastMessage) => {
cy.wait(200);
};
export const bulkUserUploadDuplicate = (file, fileName, toastMessage) => {
cy.get(usersSelector.inputFieldBulkUpload).selectFile(file, {
force: true,
});
cy.get(usersSelector.uploadedFileData).should("contain", fileName);
cy.get(usersSelector.buttonUploadUsers).click();
cy.get(commonSelectors.modalMessage)
.should("be.visible")
.and("have.text", toastMessage);
cy.get(usersSelector.modalClose).click();
cy.wait(200);
};
export const copyInvitationLink = (firstName, email) => {
cy.window().then((win) => {