Merge pull request #6166 from appium/isaac-fr

Make sure if the language is french we use the correct expected values
This commit is contained in:
Isaac A. Murchie 2016-02-19 15:00:19 -08:00
Родитель f71b5afec1 f573cf47ed
Коммит c4004afc39
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -6,14 +6,21 @@ exports.toggleTest = function (promisedBrowser, displayName, toggleElementName,
var initialValue;
it('should toggle ' + displayName, function (done) {
var on = 'ON';
var off = 'OFF';
driver
.elementByName(toggleElementName).text().then(function (txt) {
initialValue = txt;
// make sure we have the right values
if (txt === 'OUI' || txt === 'NON') {
on = 'OUI';
off = 'NON';
}
return driver[toggleMethod]();
})
.then(function () {
return driver.elementByName(toggleElementName).text().then(function (txt) {
txt.should.equal(initialValue === "ON" ? "OFF" : "ON");
txt.should.equal(initialValue === on ? off : on);
});
})
.nodeify(done);