Untitled

mail@pastecode.io avatar
unknown
typescript
a month ago
813 B
1
Indexable
Never
async loginNua(username: string, password: string): Promise<void> {
        const nuaUrl = process.env.NUA_URL;
        await Promise.all([
            this.waitForResponse(/webworker/),
            this.loadUrl(nuaUrl)
        ]);

        await allure.step(`Login in new UA with credentials "${username}/${password}"`, async () => {
            await this.usernameField.waitFor({state: 'visible'});
            await this.usernameField.fill(username);
            await this.buttonElement.click({delay: 20});
            await this.passwordField.fill(password);
            await Promise.all([
                this.waitForResponse(/dashboard\?_client_token/, [200, 500], 60000),
                this.buttonElement.click({delay: 20})
            ]);
            await this.waitLoaderToHide();
        });
    }
}
Leave a Comment