Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

chore(test): update provider and capabilities tests off of the control flow #5021

Merged
merged 5 commits into from
Nov 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ var passingTests = [
'node built/cli.js spec/plugins/browserGetUnsyncedConf.js',
'node built/cli.js spec/plugins/waitForAngularConf.js',
'node built/cli.js spec/interactionConf.js',
// 'node built/cli.js spec/directConnectConf.js',
'node built/cli.js spec/directConnectConf.js',
'node built/cli.js spec/restartBrowserBetweenTestsConf.js',
// 'node built/cli.js spec/driverProviderLocalConf.js',
// 'node built/cli.js spec/driverProviderLocalConf.js --useBlockingProxy',
// 'node built/cli.js spec/getCapabilitiesConf.js',
'node built/cli.js spec/driverProviderLocalConf.js',
'node built/cli.js spec/driverProviderLocalConf.js --useBlockingProxy',
'node built/cli.js spec/getCapabilitiesConf.js',
'node built/cli.js spec/controlLockConf.js',
// 'node built/cli.js spec/customFramework.js',
// 'node built/cli.js spec/noGlobalsConf.js',
Expand Down
18 changes: 9 additions & 9 deletions spec/directConnect/directconnect_spec.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
describe('direct connect', function() {
it('should instantiate and run', function() {
var usernameInput = element(by.model('username'));
var name = element(by.binding('username'));
describe('direct connect', () => {
it('should instantiate and run', async() => {
const usernameInput = element(by.model('username'));
const name = element(by.binding('username'));

browser.get('index.html#/form');
await browser.get('index.html#/form');

expect(name.getText()).toEqual('Anon');
expect(await name.getText()).toEqual('Anon');

usernameInput.clear();
usernameInput.sendKeys('Jane');
expect(name.getText()).toEqual('Jane');
await usernameInput.clear();
await usernameInput.sendKeys('Jane');
expect(await name.getText()).toEqual('Jane');
});
});
1 change: 1 addition & 0 deletions spec/directConnectConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var env = require('./environment.js');
// A configuration file running a simple direct connect spec
exports.config = {
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,

framework: 'jasmine',

Expand Down
1 change: 1 addition & 0 deletions spec/driverProviderLocalConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var env = require('./environment');
exports.config = {

framework: 'jasmine',
SELENIUM_PROMISE_MANAGER: false,

specs: [
'driverProviders/local/*_spec.js'
Expand Down
24 changes: 12 additions & 12 deletions spec/driverProviders/local/local_spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
describe('local driver provider', function() {
var URL = '/ng2/#/async';
describe('local driver provider', () => {
const URL = '/ng2/#/async';

it('should get a page and find an element', function() {
browser.get(URL);
var increment = $('#increment');
expect(increment).toBeDefined();
it('should get a page and find an element', async() => {
await browser.get(URL);
const increment = $('#increment');
expect(await increment.isPresent()).toBeDefined();
});

it('should get a forked instance, and find an element', function() {
browser.get(URL);
var browser2 = browser.forkNewDriverInstance();
browser2.get(URL);
var increment = browser2.$('#increment');
expect(increment).toBeDefined();
it('should get a forked instance, and find an element', async() => {
await browser.get(URL);
const browser2 = await browser.forkNewDriverInstance().ready;
await browser2.get(URL);
const increment = browser2.$('#increment');
expect(await increment.isPresent()).toBeDefined();
});
});
20 changes: 10 additions & 10 deletions spec/getCapabilitiesConf.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
var env = require('./environment.js');
var q = require('q');
const env = require('./environment.js');

exports.config = {
seleniumAddress: env.seleniumAddress,
SELENIUM_PROMISE_MANAGER: false,

// Spec patterns are relative to this directory.
specs: [
'basic/mock*'
],

framework: 'debugprint',
getMultiCapabilities: function() {
var deferred = q.defer();
getMultiCapabilities: async function() {
// Wait for a server to be ready or get capabilities asynchronously.
setTimeout(function() {
deferred.resolve([{
'browserName': 'firefox'
}]);
}, 1000);
return deferred.promise;
return await new Promise(resolve => {
setTimeout(() => {
resolve([{
'browserName': 'firefox'
}]);
}, 1000);
});
},

baseUrl: env.baseUrl + '/ng1/'
Expand Down