Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
978 B
6
Indexable

  async login(accountName: string): Promise<void> {
    for (const data of dataInfo.user) {
      if (data.account === accountName) {
        if (data.password) {
          console.log("Login with email: " + data.email + " and password: " + data.password);
          await (await this.getLocator(this.field_Email)).fill(data.email);
          await (await this.getLocator(this.button_Next)).click();
          await this.waitForLoadStateWithNetworkidleOption();
          await (await this.getLocator(this.field_Password)).fill(data.password);
          await (await this.getLocator(this.button_Next)).click();
          await this.waitLoadingBar(TimeWait.waitLoadPage);
          await this.page.waitForLoadState("networkidle");
          await this.waitForLoadStateWithNetworkidleOption();
          break;
        } else {
          console.log("Please set Password of " + data.userName);
        }
      } else {
        console.log("No Account matched");
      }
    }
  }
Leave a Comment