Skip to content

Instantly share code, notes, and snippets.

@IntranetFactory
Created November 11, 2019 20:30
Show Gist options
  • Save IntranetFactory/59c796b1a6b7870b7840c20e8ae426b1 to your computer and use it in GitHub Desktop.
Save IntranetFactory/59c796b1a6b7870b7840c20e8ae426b1 to your computer and use it in GitHub Desktop.
login to my.digitalassistant.app test tenant
const puppeteer = require('puppeteer');
const username = 'test';
const password = 'bratwurst';
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://my.digitalassistant.app/Users/Account/Login', {waitUntil: 'networkidle2'});
const usernameInput = await page.evaluateHandle(`document.querySelector("#ue").shadowRoot.querySelector("#input-1 > input")`);
const passwordInput = await page.evaluateHandle(`document.querySelector("#visibleForm > form > paper-input:nth-child(2)").shadowRoot.querySelector("#input-2 > input[type=password]")`);
const loginButton = await page.evaluateHandle('document.querySelector("#login")');
await usernameInput.focus();
await usernameInput.type(`${username}`);
await passwordInput.focus();
await passwordInput.type(`${password}`);
loginButton.click();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment