mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
Added retry mechanism.
This commit is contained in:
parent
d37a65eabc
commit
4efe667396
2 changed files with 13 additions and 2 deletions
|
@ -45,7 +45,7 @@ test.describe('Plugins page', ()=> {
|
||||||
const pluginRow = pluginTable.locator('tr').first()
|
const pluginRow = pluginTable.locator('tr').first()
|
||||||
await expect(pluginRow).toContainText('ep_font_color3')
|
await expect(pluginRow).toContainText('ep_font_color3')
|
||||||
|
|
||||||
// Select Install button
|
// Select Installation button
|
||||||
await pluginRow.locator('td').nth(4).locator('button').first().click()
|
await pluginRow.locator('td').nth(4).locator('button').first().click()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
await page.waitForSelector('table tbody')
|
await page.waitForSelector('table tbody')
|
||||||
|
|
|
@ -6,7 +6,18 @@ export const goToAdminPage = async (page: Page) => {
|
||||||
|
|
||||||
|
|
||||||
export const loginToAdmin = async (page: Page, username: string, password: string) => {
|
export const loginToAdmin = async (page: Page, username: string, password: string) => {
|
||||||
await page.goto('http://localhost:9001/admin');
|
const maxAttempts = 10;
|
||||||
|
let currentAttempt = 0;
|
||||||
|
let success = false;
|
||||||
|
|
||||||
|
while (!success && currentAttempt < maxAttempts) {
|
||||||
|
try {
|
||||||
|
await page.goto('http://localhost:9001/admin');
|
||||||
|
success = true; // If the page loads successfully, set success to true
|
||||||
|
} catch (error) {
|
||||||
|
currentAttempt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
await page.waitForSelector('input[name="username"]');
|
await page.waitForSelector('input[name="username"]');
|
||||||
await page.fill('input[name="username"]', username);
|
await page.fill('input[name="username"]', username);
|
||||||
await page.fill('input[name="password"]', password);
|
await page.fill('input[name="password"]', password);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue