Skip to content

Instantly share code, notes, and snippets.

@jlamoree
Last active January 12, 2021 21:04
Show Gist options
  • Save jlamoree/11303391 to your computer and use it in GitHub Desktop.
Save jlamoree/11303391 to your computer and use it in GitHub Desktop.
Nightwatch.js test for CKEditor components
module.exports = {
test: function (browser) {
var ckeditor = "editor1",
testtime = new Date();
browser
.url("http://ckeditor.com/demo#standard")
.resizeWindow(1024, 820)
.waitForElementVisible("#cke_" + ckeditor, 5000)
.execute(
function (instance, content) {
CKEDITOR.instances[instance].setData(content);
},
[
ckeditor,
"<h1>New Content</h1><p>Some content set at " + testtime.toString() + "</p>"
]
)
.pause(1000)
.saveScreenshot("ckeditor-screenshot-" + testtime.getTime() + ".png")
.end();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment