Created
July 27, 2015 15:52
-
-
Save tnguyen14/c1bb49f162fda54f790d to your computer and use it in GitHub Desktop.
webdriverio - click failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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