Skip to content

Commit

Permalink
Merge 811afa9 into 1020bce
Browse files Browse the repository at this point in the history
  • Loading branch information
renanrbs committed Nov 14, 2018
2 parents 1020bce + 811afa9 commit fba7eee
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const component = 'sling-web-component-login';
const customCode = false;

module.exports = {

main: (browser) => {
const testValues = {
email: 'john@doe.com',
password: 'password',
};

browser.url(`http://localhost:8777/${customCode ? 'regression' : ''}/index.html`)
.saveScreenshot(`./reports/${component}/${component}-start.png`)
.execute(function (testParams) {
const email = document.querySelector('sling-login').shadowRoot
.querySelector('sling-input[id="email"]');
email.value = testParams.email;
const password = document.querySelector('sling-login').shadowRoot
.querySelector('sling-input[id="pw"]');
password.value = testParams.password;
return { email, password };
}, [testValues], function (form) {
browser.elementIdAttribute(form.value.email.ELEMENT, 'value',
(result) => {
browser.assert.equal(result.value, testValues.email);
});
browser.elementIdAttribute(form.value.password.ELEMENT, 'value',
(result) => {
browser.assert.equal(result.value, testValues.password);
});
})
.saveScreenshot(`./reports/${component}/${component}-end.png`)
.end();
},
};

0 comments on commit fba7eee

Please sign in to comment.