Playwright start

This commit is contained in:
2026-05-30 10:04:12 -04:00
parent 73f29cea08
commit 1f7a0819fc
108 changed files with 37445 additions and 62 deletions
+40
View File
@@ -0,0 +1,40 @@
class ToastComponent {
constructor(page) {
this.page = page;
}
container() {
return this.page.locator('.toastsContainer');
}
toasts() {
return this.page.locator('.toastsContainer .toastContainer');
}
async getToastTitles() {
const titles = await this.page.locator('.toastsContainer .toastTitle').allTextContents();
return titles.map(t => t.trim()).filter(Boolean);
}
_page() {
return this.page.page || this.page;
}
async hasToastContaining(text) {
try {
await this._page().waitForFunction(
(expected) => {
const titles = document.querySelectorAll('.toastsContainer .toastTitle');
return Array.from(titles).some(t => t.textContent.trim().includes(expected));
},
text,
{ timeout: 3000 }
);
return true;
} catch {
return false;
}
}
}
module.exports = ToastComponent;