Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobjeevan committed Dec 11, 2024
1 parent 67f9c6e commit de7a7ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe("Manage User", () => {

beforeEach(() => {
cy.restoreLocalStorage();
cy.viewport(1280, 720);
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/users");
});
Expand Down Expand Up @@ -233,7 +234,7 @@ describe("Manage User", () => {
cy.wait(500);
manageUserPage.verifyLinkedSkillsTabPage();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickAddSkillButton(usernameforworkinghour);
cy.wait(500);
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
cy.wait(500);
Expand Down Expand Up @@ -268,7 +269,7 @@ describe("Manage User", () => {
manageUserPage.clickLinkedSkillTab();
manageUserPage.verifyLinkedSkillsTabPage();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickAddSkillButton(usernameToLinkSkill);
cy.verifyNotification("Skill added successfully");
cy.closeNotification();
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ export class ManageUserPage {
cy.get("[data-testid='user-delete-button']").click();
}

clickAddSkillButton() {
cy.intercept("GET", "**/api/v1/skill/**").as("getSkills");
clickAddSkillButton(username: string) {
cy.intercept("GET", `**/api/v1/users/${username}/skill/**`).as("getSkills");
cy.get("#add-skill-button").click();
cy.wait("@getSkills").its("response.statusCode").should("eq", 200);
}
Expand Down

0 comments on commit de7a7ef

Please sign in to comment.