2021-03-05 13:47:59 +00:00
|
|
|
export default class InitialAccessTokenTab {
|
2021-03-24 14:07:49 +00:00
|
|
|
private initialAccessTokenTab = "initialAccessToken";
|
|
|
|
|
2021-03-05 13:47:59 +00:00
|
|
|
private emptyAction = "empty-primary-action";
|
|
|
|
|
|
|
|
private expirationInput = "expiration";
|
|
|
|
private countInput = "count";
|
|
|
|
private saveBtn = "save";
|
|
|
|
|
2021-03-24 14:07:49 +00:00
|
|
|
goToInitialAccessTokenTab() {
|
|
|
|
cy.getId(this.initialAccessTokenTab).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-03-05 13:47:59 +00:00
|
|
|
shouldBeEmpty() {
|
|
|
|
cy.getId(this.emptyAction).should("exist");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
shouldNotBeEmpty() {
|
|
|
|
cy.getId(this.emptyAction).should("not.exist");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
getFistId(callback: (id: string) => void) {
|
|
|
|
cy.get('tbody > tr > [data-label="ID"]')
|
|
|
|
.invoke("text")
|
|
|
|
.then((text) => {
|
|
|
|
callback(text);
|
|
|
|
});
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
createNewToken(expiration: number, count: number) {
|
|
|
|
cy.getId(this.emptyAction).click();
|
|
|
|
cy.getId(this.expirationInput).type(`${expiration}`);
|
|
|
|
cy.getId(this.countInput).type(`${count}`);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
save() {
|
|
|
|
cy.getId(this.saveBtn).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|