webdriverio - click failure
'use strict'; | |
var webdriverio = require('webdriverio'); | |
var assert = require('chai').assert; | |
var client = webdriverio.remote({ | |
desiredCapabilities: { | |
browserName: 'chrome' | |
}, | |
baseUrl: 'https://dev10-sitegenesis-dw.demandware.net/s/SiteGenesis' | |
}); | |
describe('carousel tests', function () { | |
before(function () { | |
return client.init(); | |
}); | |
beforeEach(function () { | |
return client.url('/home'); | |
}); | |
it('click on carousel #1', function () { | |
var controlSelector = '#homepage-slider .jcarousel-control a:nth-child(1)'; | |
return client.waitForExist(controlSelector) | |
.click(controlSelector) | |
.pause(500) | |
.click('#homepage-slider') | |
.getTitle() | |
.then(function (title) { | |
title = title.split('|')[0].trim(); | |
assert.equal(title, 'Mens Suits for Business and Casual'); | |
}); | |
}); | |
it('click on carousel #2', function () { | |
var controlSelector = '#homepage-slider .jcarousel-control a:nth-child(2)'; | |
return client.waitForExist(controlSelector) | |
.click(controlSelector) | |
.pause(500) | |
.click('#homepage-slider') | |
.getTitle() | |
.then(function (title) { | |
title = title.split('|')[0].trim(); | |
assert.equal(title, 'Women\'s Accessories Belts, Wallets. Gloves, Hats, Watches, Luggage & More'); | |
}); | |
}); | |
it('click on carousel #3', function () { | |
var controlSelector = '#homepage-slider .jcarousel-control a:nth-child(3)'; | |
return client.waitForExist(controlSelector) | |
.click(controlSelector) | |
.pause(500) | |
.click('#homepage-slider') | |
.getTitle() | |
.then(function (title) { | |
title = title.split('|')[0].trim(); | |
assert.equal(title, 'Womens Shoes Including Casual, Flat, Mid Heels & High Heels'); | |
}); | |
}); | |
after(function () { | |
return client.end(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment