Skip to content

Commit

Permalink
flow login error to the console
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorfr committed Jul 29, 2018
1 parent 3060a47 commit c867240
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tasks/GhostThemeUploader/ghostThemeUploaderTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ async function themeUpload() {
await takeScreenshot(page, 'login.done.png');
console.log('Logged in with ', userName);

var mainError = await page.$('p.main-error');
if (mainError != null){
var message = await page.evaluate(document => document.querySelector('p.main-error').innerText) as string;
throw new Error(message);
}

await page.goto(page.url() + 'settings/design', { waitUntil: 'networkidle0' });
await takeScreenshot(page, 'theme.page.png');

Expand Down

0 comments on commit c867240

Please sign in to comment.