-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransactionDetailsHeaderTab.ts
More file actions
47 lines (37 loc) · 1.12 KB
/
TransactionDetailsHeaderTab.ts
File metadata and controls
47 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Locator, Page } from '@playwright/test';
import BasePageModel from '@/pages/BasePageModel';
class TransactionDetailsHeaderTab extends BasePageModel {
constructor(page: Page) {
super(page);
}
get section() {
return this.page.locator('#transaction-header');
}
get table() {
return this.section.getByRole('table');
}
get rows() {
return this.table.getByRole('row');
}
row(index: number) {
return new Row(this.page, this.rows.nth(index));
}
}
class Row extends BasePageModel {
row: Locator;
constructor(page: Page, row: Locator) {
super(page);
this.row = row;
}
get transactionDateMinuteSelect() {
return this.row.locator('select[name="transactionDate_minute"]');
}
async decreaseMinute() {
const selectedValue = await this.transactionDateMinuteSelect.inputValue();
const parsedValue = parseInt(selectedValue || '0', 10);
const nextMinute = (parsedValue - 1 + 60) % 60;
const optionToSelect = String(nextMinute).padStart(2, '0');
await this.transactionDateMinuteSelect.selectOption(optionToSelect);
}
}
export default TransactionDetailsHeaderTab;