github.com/minio/console@v1.4.1/web-app/e2e/pom/BucketSummaryPage.tsx (about) 1 import { Page, Locator } from "@playwright/test"; 2 3 export class BucketSummaryPage { 4 page: Page; 5 bucketName: string; 6 7 /* Locators */ 8 deleteBucketBtn: Locator | undefined; 9 10 constructor(page: Page, bucketName: string) { 11 this.page = page; 12 this.bucketName = bucketName; 13 14 this.initLocators(); 15 } 16 getLocator(selector: string): Locator { 17 const page = this.page; 18 const locator: Locator = page.locator(`${selector}`); 19 return locator; 20 } 21 22 initLocators() { 23 this.deleteBucketBtn = this.getLocator("#delete-bucket-button"); 24 } 25 26 async loadPage() { 27 await this.clickOnTab(`Summary`); 28 } 29 30 async clickOnTab(tabID: string) { 31 await this.getLocator(`#${tabID}`).click(); 32 33 // await page.goto(`${BUCKET_LIST_PAGE}/${this.bucketName}/admin/${tabName}`); 34 } 35 36 async confirmDeleteBucket() { 37 await this.getLocator("#delete-bucket-button").click(); 38 await this.getLocator("#confirm-ok").click(); 39 } 40 41 async getObjectVersionOption() { 42 await this.page.getByRole("button", { name: "Add Lifecycle Rule" }).click(); 43 return this.getLocator("#object_version-select > div").nth(0); 44 } 45 }