-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
14025bf
commit 9d98ebc
Showing
22 changed files
with
468 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,4 @@ module.exports = defineConfig({ | |
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
], | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,64 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
export class ProfileCrewFormPage { | ||
|
||
constructor(page) { | ||
this.page = page; | ||
} | ||
|
||
async addMember(username, owner=true, success=true) { | ||
async addMember(username, owner = true, success = true) { | ||
await Promise.all([ | ||
this.page.waitForResponse(response => response.url().includes("/new") && response.status() === 200, {timeout: 60000}), | ||
this.page.getByTestId('add-member').click() | ||
this.page.waitForResponse( | ||
(response) => response.url().includes('/new') && response.status() === 200, | ||
{ timeout: 60000 } | ||
), | ||
this.page.getByTestId('add-member').click(), | ||
]); | ||
await this.page.locator('.select2-selection__arrow').waitFor() | ||
await this.page.locator('.select2-selection__arrow').waitFor(); | ||
await this.page.locator('.select2-selection__arrow').click(); | ||
await this.page.locator('.select2-search__field').waitFor(); | ||
await this.page.locator('.select2-search__field').fill(username); | ||
await this.page.locator('.select2-results__option').waitFor(); | ||
await this.page.locator('.select2-results__option').click(); | ||
if(owner) { | ||
if (owner) { | ||
await this.page.locator('div#field-is_owner input[value="True"]').click(); | ||
} | ||
else { | ||
} else { | ||
await this.page.locator('div#field-is_owner input[value="False"]').click(); | ||
} | ||
await Promise.all([ | ||
this.page.waitForRequest(request => request.url().includes("/new"), {timeout: 60000}), | ||
this.page.getByTestId('form-submit-btn').getByText('Add member').click() | ||
this.page.waitForRequest((request) => request.url().includes('/new'), { | ||
timeout: 60000, | ||
}), | ||
this.page.getByTestId('form-submit-btn').getByText('Add member').click(), | ||
]); | ||
if(success) { | ||
await this.page.locator('data-test-id="member":has-text("' + username + '")').isVisible(); | ||
await expect(this.page.locator('.toast-message')).toHaveCount(0, {timeout: 7000}); | ||
if (success) { | ||
await this.page | ||
.locator('data-test-id="member":has-text("' + username + '")') | ||
.isVisible(); | ||
await expect(this.page.locator('.toast-message')).toHaveCount(0, { | ||
timeout: 7000, | ||
}); | ||
} else { | ||
await this.page.locator('p.mui--text-danger').isVisible(); | ||
await this.page.locator('a.modal__close').locator('visible=true').click(); | ||
} | ||
|
||
} | ||
|
||
async deleteMember(username) { | ||
await Promise.all([ | ||
this.page.waitForResponse(response => response.url().includes("/edit") && response.status() === 200, {timeout: 60000}), | ||
this.page.waitForResponse( | ||
(response) => response.url().includes('/edit') && response.status() === 200, | ||
{ timeout: 60000 } | ||
), | ||
this.page.getByTestId('member').getByText(username).click(), | ||
]); | ||
await Promise.all([ | ||
this.page.waitForResponse(response => response.url().includes("/delete") && response.status() === 200, {timeout: 60000}), | ||
this.page.waitForResponse( | ||
(response) => response.url().includes('/delete') && response.status() === 200, | ||
{ timeout: 60000 } | ||
), | ||
this.page.getByTestId('revoke-btn').click(), | ||
]); | ||
await this.page.getByTestId('form-submit-btn').waitFor(3000); | ||
await this.page.getByTestId('form-submit-btn').click(); | ||
} | ||
|
||
} |
Oops, something went wrong.