How to use the taiko.write function in taiko

To help you get started, we’ve selected a few taiko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getgauge / taiko / examples / 08-contenteditable.js View on Github external
(async () => {
  try {
    await openBrowserAndStartScreencast(
      path.join('captures', 'contenteditable', 'contenteditable.gif'),
    );
    // a local file with simple `contenteditable`
    await goto('file:///' + cwd + '/data/contenteditable.html');
    var text = 'Taiko writes into a contenteditable field!';
    await write(text, into(textBox(below('Editable Demo'))));
    var content = await textBox(below('Editable Demo')).text();
    expect(content).to.have.string(text);

    // a rich text editor
    await goto('http://localhost:3000/tinymce');
    text = 'Taiko writes into a tinyMCE editor';
    await write(text, into(textBox(below('An iFrame'))));
    content = await into(textBox(below('An iFrame'))).text();
    expect(content).to.have.string(text);
  } catch (e) {
    console.error(e);
    process.exitCode = 1;
  } finally {
    await closeBrowserAndStopScreencast();
  }
})();
github getgauge / taiko / examples / 08-contenteditable.js View on Github external
(async () => {
  try {
    await openBrowserAndStartScreencast(
      path.join('captures', 'contenteditable', 'contenteditable.gif'),
    );
    // a local file with simple `contenteditable`
    await goto('file:///' + cwd + '/data/contenteditable.html');
    var text = 'Taiko writes into a contenteditable field!';
    await write(text, into(textBox(below('Editable Demo'))));
    var content = await textBox(below('Editable Demo')).text();
    expect(content).to.have.string(text);

    // a rich text editor
    await goto('http://localhost:3000/tinymce');
    text = 'Taiko writes into a tinyMCE editor';
    await write(text, into(textBox(below('An iFrame'))));
    content = await into(textBox(below('An iFrame'))).text();
    expect(content).to.have.string(text);
  } catch (e) {
    console.error(e);
    process.exitCode = 1;
  } finally {
    await closeBrowserAndStopScreencast();
  }
})();

taiko

Taiko is a Node.js library for automating Chromium based browsers

MIT
Latest version published 4 months ago

Package Health Score

77 / 100
Full package analysis