Skip to content

Conversation

@DavertMik
Copy link
Contributor

  • Update to NodeJS v8
  • Refactor helpers to use async/await
  • Merge Protractor & SeleniumWebDriver helpers

yield I.seeCurrentUrlEquals(`${site_url}/info`);
return I.dontSeeCurrentUrlEquals(`${site_url}/form`);
yield I.seeCurrentUrlEquals(`${siteUrl}/info`);
return I.dontSeeCurrentUrlEquals(`${siteUrl}/form`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

yield I.amOnPage('/info');
yield I.seeCurrentUrlEquals(`${site_url}/info`);
return I.dontSeeCurrentUrlEquals(`${site_url}/form`);
yield I.seeCurrentUrlEquals(`${siteUrl}/info`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'template literal syntax' is only available in ES6 (use 'esversion: 6').

let I;
let data;
let site_url;
let siteUrl;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

it('should open any page of configured site', () => wd.amOnPage('/info').getUrl().then(url => url.should.eql(`${siteUrl}/info`)));

it('should open absolute url', () => wd.amOnPage(site_url).getUrl().then(url => url.should.eql(`${site_url}/`)));
it('should open absolute url', () => wd.amOnPage(siteUrl).getUrl().then(url => url.should.eql(`${siteUrl}/`)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
'template literal syntax' is only available in ES6 (use 'esversion: 6').

it('should open main page of configured site', () => wd.amOnPage('/').getUrl().then(url => url.should.eql(`${siteUrl}/`)));

it('should open any page of configured site', () => wd.amOnPage('/info').getUrl().then(url => url.should.eql(`${site_url}/info`)));
it('should open any page of configured site', () => wd.amOnPage('/info').getUrl().then(url => url.should.eql(`${siteUrl}/info`)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
'template literal syntax' is only available in ES6 (use 'esversion: 6').


let wd;
const site_url = TestHelper.siteUrl();
const siteUrl = TestHelper.siteUrl();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const TestHelper = require('../support/TestHelper');

const site_url = 'http://davertmik.github.io/angular-demo-app';
const siteUrl = 'http://davertmik.github.io/angular-demo-app';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const TestHelper = require('../support/TestHelper');

const Protractor = require('../../lib/helper/Protractor');
const TestHelper = require('../support/TestHelper');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

return url.should.eql(`${site_url}/`);
yield I.amOnPage(siteUrl);
let url = yield browser.getCurrentUrl();
return url.should.eql(`${siteUrl}/`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

const url = yield browser.getCurrentUrl();
return url.should.eql(`${site_url}/`);
yield I.amOnPage(siteUrl);
let url = yield browser.getCurrentUrl();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class properties must be methods. Expected '(' but instead saw 'new'.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
Expected an identifier and instead saw '${'.
'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option).
Expected an identifier and instead saw ')'.
Expected an operator and instead saw '.'.
Expected an identifier and instead saw '{a}'.
Class properties must be methods. Expected '(' but instead saw '}'.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

lib/locator.js Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

lib/locator.js Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'template literal syntax' is only available in ES6 (use 'esversion: 6').

lib/locator.js Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

lib/locator.js Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

submittedData(dataFile) {
return function (key) {
if (!fs.existsSync(dataFile)) {
const waitTill = new Date(new Date().getTime() + 1 * 1000); // wait for one sec for file to be created

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

yield I.amOnPage(siteUrl);
const url = yield browser.getCurrentUrl();
return url.should.eql(`${site_url}/`);
return url.should.eql(`${siteUrl}/`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').


it('should open absolute url', function* () {
I.amOnPage(site_url);
yield I.amOnPage(siteUrl);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

yield I.amOnPage('/info');
const url = yield browser.getCurrentUrl();
return url.should.eql(`${site_url}/info`);
return url.should.eql(`${siteUrl}/info`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').


it('should open any page of configured site', function* () {
I.amOnPage('/info');
yield I.amOnPage('/info');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

yield I.amOnPage('/');
const url = yield browser.getCurrentUrl();
return url.should.eql(`${site_url}/`);
return url.should.eql(`${siteUrl}/`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

describe('open page : #amOnPage', () => {
it('should open main page of configured site', function* () {
I.amOnPage('/');
yield I.amOnPage('/');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'yield' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

if (I.isProtractor5) return;
return I.waitForText('Boom!', 0.5)
.thenCatch((e) => {
.then(() => { throw new Error('😟') })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

if (I.isProtractor5) return;
return I.waitForText('Nothing here', 0, '#hello')
.thenCatch((e) => {
.then(() => { throw new Error('😟') })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

url: siteUrl,
browser: 'chrome',
seleniumAddress: TestHelper.seleniumAddress(),
angular: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing comma comma-dangle

@codeceptjs codeceptjs deleted a comment from houndci-bot Dec 5, 2017
@codeceptjs codeceptjs deleted a comment from houndci-bot Dec 5, 2017
@codeceptjs codeceptjs deleted a comment from houndci-bot Dec 5, 2017
@codeceptjs codeceptjs deleted a comment from houndci-bot Dec 5, 2017
lib/locator.js Outdated

function isXPath(locator) {
return locator.substr(0, 2) === '//' || locator.substr(0, 3) === './/';
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline required at end of file but not found eol-last

lib/locator.js Outdated

function isXPath(locator) {
return locator.substr(0, 2) === '//' || locator.substr(0, 3) === './/';
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline required at end of file but not found eol-last


const site_url = 'http://davertmik.github.io/angular-demo-app';
const web_app_url = TestHelper.siteUrl();
const TestHelper = require('../support/TestHelper');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../support/TestHelper' import/no-unresolved


let I;
let browser;
const should = require('chai').should();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'chai' import/no-unresolved

const fileExists = require('../../lib/utils').fileExists;
const Protractor = require('../../lib/helper/Protractor');
const AssertionFailedError = require('../../lib/assert/error');
const webApiTests = require('./webapi');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module './webapi' import/no-unresolved

const path = require('path');
const fs = require('fs');
const fileExists = require('../../lib/utils').fileExists;
const Protractor = require('../../lib/helper/Protractor');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../../lib/helper/Protractor' import/no-unresolved

@@ -0,0 +1,165 @@
const xpathLocator = require('./utils').xpathLocator;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module './utils' import/no-unresolved

const co = require('co');
const path = require('path');
const recorder = require('../recorder');
const ElementNotFound = require('./errors/ElementNotFound');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module './errors/ElementNotFound' import/no-unresolved

const clearString = require('../utils').clearString;
const co = require('co');
const path = require('path');
const recorder = require('../recorder');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../recorder' import/no-unresolved

@@ -1,4 +1,5 @@
const requireg = require('requireg');
const Locator = require('../locator');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../locator' import/no-unresolved

const els = await findFields(this.browser, locator);
assertElementExists(els, locator, 'Field');
if (this.options.browser !== 'phantomjs') {
const remote = require('selenium-webdriver/remote');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module 'selenium-webdriver/remote' import/no-unresolved

const ElementNotFound = require('./errors/ElementNotFound');
const Locator = require('../locator');
const path = require('path');
const recorder = require('../recorder');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../recorder' import/no-unresolved

"no-cond-assign": 0,
"array-callback-return": 0,
"function-paren-newline": 0
"import/no-unresolved": 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hound CI can't parse this rule. Also, it depends on current installation settings so strictly following it won't be helpful.

"array-callback-return": 0,
"function-paren-newline": 0
"import/no-unresolved": 0,
"no-await-in-loop": 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have loops where await is used following if conditions. There is no clean way to rework it in Promise.all

"function-paren-newline": 0
"import/no-unresolved": 0,
"no-await-in-loop": 0,
"arrow-body-style": 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes some linex extra long and unreadable

@galkin galkin merged commit 24bf12d into master Dec 5, 2017
@galkin galkin deleted the refactoring branch December 5, 2017 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants