1
|
import {browser, by, element} from 'protractor';
|
2
|
|
3
|
export class SensorPo {
|
4
|
async clickByXpath(xPath: string): Promise<unknown> {
|
5
|
return element(by.xpath(xPath)).click();
|
6
|
}
|
7
|
|
8
|
async clickById(id: string): Promise<unknown> {
|
9
|
return element(by.id(id)).click();
|
10
|
}
|
11
|
|
12
|
async setDateInXpath(xPath: string): Promise<unknown> {
|
13
|
element(by.xpath(xPath)).click();
|
14
|
await browser.sleep(500);
|
15
|
element(by.className('p-datepicker-prev-icon')).click();
|
16
|
await browser.sleep(500);
|
17
|
return element(by.xpath('//td[contains(@class, \'ng-star-inserted\') and not(contains(@class, \'p-datepicker-other-month\'))]'))
|
18
|
.click();
|
19
|
}
|
20
|
}
|