fix firefox search e2e
parent
8f27a774af
commit
3b063de52a
|
@ -14,7 +14,7 @@ describe('search page', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('lightbox', async function() {
|
it('lightbox', async function() {
|
||||||
$('#nav-search').click();
|
$('#nav-search a').click();
|
||||||
|
|
||||||
let searchLb = $('div[tg-search-box]');
|
let searchLb = $('div[tg-search-box]');
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ describe('search page', function() {
|
||||||
it('change current tab content on typing in the right column', async function() {
|
it('change current tab content on typing in the right column', async function() {
|
||||||
let text = await $$('.table-main').get(0).$('a').getText();
|
let text = await $$('.table-main').get(0).$('a').getText();
|
||||||
|
|
||||||
|
let initialCount = await $$('.table-main').count();
|
||||||
|
|
||||||
let searchTerm = element(by.model('searchTerm'));
|
let searchTerm = element(by.model('searchTerm'));
|
||||||
|
|
||||||
searchTerm.clear();
|
searchTerm.clear();
|
||||||
|
@ -93,7 +95,8 @@ describe('search page', function() {
|
||||||
|
|
||||||
let count = await $$('.table-main').count();
|
let count = await $$('.table-main').count();
|
||||||
|
|
||||||
expect(count).to.equal(1);
|
expect(count).to.below(initialCount);
|
||||||
|
expect(count).to.above(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,22 @@ var fs = require('fs');
|
||||||
var uuid = require('node-uuid');
|
var uuid = require('node-uuid');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
|
common.getElm = function(el) {
|
||||||
|
var deferred = protractor.promise.defer();
|
||||||
|
|
||||||
|
if (typeof el === 'string' || el instanceof String) {
|
||||||
|
browser.wait(function() {
|
||||||
|
return browser.isElementPresent($(el).locator());
|
||||||
|
}, 4000).then(() => {
|
||||||
|
deferred.fulfill($(el));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
deferred.fulfill($(el));
|
||||||
|
}
|
||||||
|
|
||||||
|
return deferred.promise;
|
||||||
|
};
|
||||||
|
|
||||||
common.hasClass = async function (element, cls) {
|
common.hasClass = async function (element, cls) {
|
||||||
let classes = await element.getAttribute('class');
|
let classes = await element.getAttribute('class');
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@ var transition = 300;
|
||||||
lightbox.open = async function(el) {
|
lightbox.open = async function(el) {
|
||||||
var deferred = protractor.promise.defer();
|
var deferred = protractor.promise.defer();
|
||||||
|
|
||||||
if (typeof el == 'string' || el instanceof String) {
|
if (typeof el === 'string' || el instanceof String) {
|
||||||
el = $(el);
|
el = $(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
let open = await browser.wait(function() {
|
let open = await browser.wait(function() {
|
||||||
return common.hasClass(el, 'open')
|
return common.hasClass(el, 'open');
|
||||||
}, 4000);
|
}, 4000);
|
||||||
|
|
||||||
await browser.sleep(transition);
|
await browser.sleep(transition);
|
||||||
|
|
Loading…
Reference in New Issue