Skip to content

Commit

Permalink
update playwright library, replace deprecated method type()
Browse files Browse the repository at this point in the history
  • Loading branch information
KateMaruk committed Oct 26, 2023
1 parent d38d6d7 commit e44929e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 43 deletions.
76 changes: 43 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/penpot/penpotqa#readme",
"devDependencies": {
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.39.0",
"dotenv": "^16.3.1"
},
"dependencies": {
Expand Down
16 changes: 8 additions & 8 deletions pages/dashboard-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
for (let i = 0; i <= text.length; i++) {
await this.page.keyboard.press("Backspace");
}
await this.fileNameInput.type(newFileName);
await this.fileNameInput.pressSequentially(newFileName);
await this.page.keyboard.press("Enter");
await this.isFilePresent(newFileName);
}
Expand All @@ -251,7 +251,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
for (let i = 0; i <= text.length; i++) {
await this.page.keyboard.press("Backspace");
}
await this.fileNameInput.type(newFileName);
await this.fileNameInput.pressSequentially(newFileName);
await this.page.keyboard.press("Enter");
await this.isFilePresent(newFileName);
}
Expand Down Expand Up @@ -348,7 +348,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
}

async setProjectName(newProjectName) {
await this.projectNameInput.type(newProjectName);
await this.projectNameInput.pressSequentially(newProjectName);
await this.page.keyboard.press("Enter");
}

Expand All @@ -370,7 +370,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
for (let i = 0; i <= text.length; i++) {
await this.page.keyboard.press("Backspace");
}
await this.projectNameInput.type(newProjectName);
await this.projectNameInput.pressSequentially(newProjectName);
await this.page.keyboard.press("Enter");
await expect(this.projectNameTitle.first()).toHaveText(newProjectName);
}
Expand All @@ -384,7 +384,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
for (let i = 0; i <= text.length; i++) {
await this.page.keyboard.press("Backspace");
}
await this.projectNameInput.type(newProjectName);
await this.projectNameInput.pressSequentially(newProjectName);
await this.page.keyboard.press("Enter");
await expect(this.projectNameTitle.first()).toHaveText(newProjectName);
}
Expand Down Expand Up @@ -448,7 +448,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
}

async search(text) {
await this.searchInput.type(text);
await this.searchInput.pressSequentially(text);
}

async uploadFont(filePath) {
Expand Down Expand Up @@ -496,13 +496,13 @@ exports.DashboardPage = class DashboardPage extends BasePage {
await this.fontOptionsMenuButton.click();
await this.editFontMenuItem.click();
await this.clearInput(this.fontNameInput);
await this.fontNameInput.type(newFontName);
await this.fontNameInput.pressSequentially(newFontName);
await this.saveFontButton.click();
await expect(this.fontNameTableCell).toHaveText(newFontName);
}

async searchFont(fontName) {
await this.searchFontInput.type(fontName);
await this.searchFontInput.pressSequentially(fontName);
await expect(this.fontNameTableCell).toHaveText(fontName);
await expect(this.fontNameTableCell).toHaveCount(1);
}
Expand Down
2 changes: 1 addition & 1 deletion pages/team-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ exports.TeamPage = class TeamPage extends BasePage {
}

async enterEmailToInviteMembersPopUp(email) {
await this.inviteMembersToTeamEmailInput.type(email);
await this.inviteMembersToTeamEmailInput.pressSequentially(email);
}

async clickSendInvitationButton() {
Expand Down

0 comments on commit e44929e

Please sign in to comment.