-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into exui-2078-high-vuln
- Loading branch information
Showing
36 changed files
with
1,402 additions
and
1,473 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export async function retryAction(action: () => Promise<void>, numberOfTries: number = 5) { | ||
for (let i = 0; i < numberOfTries; i++) { | ||
try { | ||
await action(); | ||
break; // Exit loop if action succeeds | ||
} catch (error) { | ||
console.log(`Action failed, retrying (${i + 1}/${numberOfTries})...`); | ||
if (i === numberOfTries - 1) throw error; // Rethrow error on last attempt | ||
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait 1 second before retrying | ||
} | ||
} | ||
} |
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,15 +1,17 @@ | ||
export async function clickToStaffPage(page) { | ||
console.log("Going to Staff Page"); | ||
const numberOfTries = 5; | ||
for (let i = 0; i < numberOfTries; i++) { | ||
try { | ||
await page.getByRole('link', { name: 'Staff' }).click(); | ||
await page.waitForSelector('text=User list', { state: 'visible', timeout: 1000 }); | ||
break; | ||
} catch (error) { | ||
console.log(`Click to staff page failed, retrying (${i + 1}/${numberOfTries})...`); | ||
if (i !== numberOfTries) await page.waitForTimeout(1000); // Wait 1 second before the next attempt | ||
else throw error; | ||
} | ||
} | ||
} | ||
import { retryAction } from './retry-steps'; | ||
|
||
export async function clickToStaffPage(page) { | ||
console.log("Going to Staff Page"); | ||
await retryAction(async () => { | ||
await page.getByRole('link', { name: 'Staff' }).click(); | ||
await page.waitForSelector('text=User list', { state: 'visible', timeout: 1000 }); | ||
}); | ||
} | ||
|
||
export async function fillSearchBox(page) { | ||
console.log("Fill SearchBox"); | ||
await retryAction(async () => { | ||
await page.locator('#main-content').getByRole('textbox').click(); | ||
await page.locator('#main-content').getByRole('textbox').fill('xui'); | ||
}); | ||
} |
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
Oops, something went wrong.