schickling/chromeless

Interacting with an Auth0 Login

Open

#338 ouverte le 16 nov. 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)TypeScript (13 240 stars) (606 forks)batch import
help wantedquestion

Description

Hi I'm at the beginning stages of adding e2e tests to a project with chromeless.

My app uses Auth0 and navigates to their hosted login page if login check fails on first load of the application.

So this happens at the start of my e2e test.

I have the following snippet I'm using:


const { Chromeless } = require('chromeless')

async function run() {
  const chromeless = new Chromeless()

  const screenshot = await chromeless
    .goto('MyApp.com')
    .wait('input')
    .type('email@me.com, 'input[type="email"]')
    .type('pass', 'input[type="password"]')
    .click('.auth0-label-submit')
    .screenshot()

  console.log(screenshot) // prints local file path or S3 url

  await chromeless.end()
}

run().catch(console.error.bind(console))

I'm getting an error from chrome-remote-interface:

   { Error: Element is not focusable
    at /Users/mikejames/projects/company/myApp/node_modules/chrome-remote-interface/lib/chrome.js:90:30
    at Chrome.handleMessage (/Users/mikejames/projects/company/myApp/node_modules/chrome-remote-interface/lib/chrome.js:289:13)
    at WebSocket.<anonymous> (/Users/mikejames/projects/company/myApp/node_modules/chrome-remote-interface/lib/chrome.js:266:27)
    at emitTwo (events.js:125:13)
    at WebSocket.emit (events.js:213:7)
    at Receiver._receiver.onmessage (/Users/mikejames/projects/company/myApp/node_modules/ws/lib/WebSocket.js:143:54)
    at Receiver.dataMessage (/Users/mikejames/projects/company/myApp/node_modules/ws/lib/Receiver.js:385:14)
    at extension.decompress (/Users/mikejames/projects/company/myApp/node_modules/ws/lib/Receiver.js:354:40)
    at _inflate.flush (/Users/mikejames/projects/company/myApp/node_modules/ws/lib/PerMessageDeflate.js:279:12)
    at afterWrite (_stream_writable.js:438:3)
    at onwrite (_stream_writable.js:429:7)
  response: { code: -32000, message: 'Element is not focusable' } }
Component Version
Operating system OSX 10.13.1
Node.js 8.1.3
Chrome/Chromium/... Chrome
chrome-remote-interface 0.24.5

Is Chrome running in a container? NO

Guide contributeur