Skip to content

Instantly share code, notes, and snippets.

@AlexanderMoskovkin
Created January 10, 2018 09:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderMoskovkin/897073929442db031d518e1e6db4ec9e to your computer and use it in GitHub Desktop.
Save AlexanderMoskovkin/897073929442db031d518e1e6db4ec9e to your computer and use it in GitHub Desktop.
TestCafe with ShadowDOM example
import { Selector } from 'testcafe';
fixture `Shadow DOM Example`
.page `https://jsfiddle.net/txyamhcj/`;
test('Type inside shadowDOM', async t => {
const outputIframe = Selector('iframe').withAttribute('name', 'result');
const shadowInput = Selector(() => document.querySelector('#host').shadowRoot.querySelector('#txtTest'));
await t
.switchToIframe(outputIframe)
.typeText(shadowInput, 'This is Shadow Input!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment