client path small refactor for login helper
This commit is contained in:
parent
2721b87e57
commit
0876a38104
|
@ -8,12 +8,12 @@ function child(selector, childNumber) {
|
|||
return selector.replace(aux[0], `${aux[0]}:nth-child(${childNumber})`);
|
||||
}
|
||||
|
||||
Nightmare.action('login', function(name, password, done) {
|
||||
Nightmare.action('login', function(done) {
|
||||
try {
|
||||
this.goto(`${config.url}auth/?apiKey=salix`)
|
||||
.wait(`${components.textFieldInput}`)
|
||||
.write(`${child(components.textFieldInput, 1)}`, name)
|
||||
.write(`${child(components.textFieldInput, 2)}`, password)
|
||||
.write(`${child(components.textFieldInput, 1)}`, 'nightmare')
|
||||
.write(`${child(components.textFieldInput, 2)}`, 'nithmarePassword')
|
||||
.click(components.submitButton)
|
||||
.then(done);
|
||||
} catch (err) {
|
||||
|
|
|
@ -8,8 +8,8 @@ const nightmare = createNightmare();
|
|||
describe('Clients path', () => {
|
||||
fit('should log in', done => {
|
||||
nightmare
|
||||
.login('nightmare', 'NightmarePassword')
|
||||
.wait(1000)
|
||||
.login()
|
||||
.wait(200)
|
||||
.url()
|
||||
.then(url => {
|
||||
expect(url).toBe(config.url + '#!/');
|
||||
|
|
Loading…
Reference in New Issue