Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9 #12

Merged
merged 17 commits into from
Nov 28, 2017
Merged

#9 #12

Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict'

const fs = require('fs');
const files = fs.readdirSync('./src/steps');
const fs = require('fs')
const files = fs.readdirSync('./src/steps')

files.forEach((f) => {
const path = `./src/steps/${f}`
const fileSteps = require(path);
const fileSteps = require(path)

if (typeof fileSteps === 'function') {
fileSteps.apply(this);
fileSteps.apply(this)
}
});
})
4 changes: 2 additions & 2 deletions src/helpers/objects.processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ function getPageObject(str) {
const pageObjectGetterFunc = objectsProcessor.pageObjectGetter || pageObjectGetter
const value = pageObjectGetterFunc(str)
const idValue = value.replace(_r(regDynamicId, 'g'), id.getId())
const injection = 'not(ancestor-or-self::*[contains(@style,"visibility: hidden;") ' +
Copy link
Member

Choose a reason for hiding this comment

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

Let's not remove semicolons from CSS "visibility: hidden;"

'or contains(@style,"display: none;") or contains(@class,"x-hide-offsets")])';
const injection = 'not(ancestor-or-self::*[contains(@style,"visibility: hidden") ' +
'or contains(@style,"display: none") or contains(@class,"x-hide-offsets")])'
const injectedvalue = injectInto(idValue, injection)

return injectedvalue
Expand Down
8 changes: 4 additions & 4 deletions src/steps/given.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict'

const { defineSupportCode } = require('cucumber');
const { defineSupportCode } = require('cucumber')
const { dictionaryObject, getDictionaryObject } = require('../helpers/objects.processor')
const { _r } = require('../helpers/utils')

Expand All @@ -16,8 +16,8 @@ module.exports = function () {
*/
const url = getDictionaryObject.call(this, urlDictionary)

browser.url(url);
});
browser.url(url)
})

});
})
}
8 changes: 4 additions & 4 deletions src/steps/then.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict'

const { defineSupportCode } = require('cucumber');
const { defineSupportCode } = require('cucumber')
const { pageObject, getPageObject } = require('../helpers/objects.processor')
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets try to use no semicolons.

const { _r } = require('../helpers/utils')
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line


Expand All @@ -16,8 +16,8 @@ module.exports = function () {
*/
const locator = getPageObject(object)
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets try to use no semicolons.


browser.$(locator).waitForExist();
});
browser.$(locator).waitForExist()
})

});
})
}
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets try to use no semicolons.

4 changes: 2 additions & 2 deletions test/features/page_objects/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
'use strict'
let e = {}
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets try to use no semicolons.


e.txtHeader = '//*[@id="header"]';
e.txtHeader = '//*[@id="header"]'

module.exports = e
Copy link
Member

Choose a reason for hiding this comment

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

; is missing at the end of a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets try to use no semicolons.

26 changes: 13 additions & 13 deletions test/mocha/objects.processor.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict'

const { expect } = require('chai')

Expand Down Expand Up @@ -39,18 +39,18 @@ describe('injectInto', () => {

data.forEach((d) => {
it(`should get "${d.result}" string from "${d.locator}" and "${d.injection}" injection`, () => {
expect(injectInto(d.locator, d.injection)).to.be.equals(d.result);
});
});
});
expect(injectInto(d.locator, d.injection)).to.be.equals(d.result)
})
})
})

describe('getPageObject', () => {
const data = [
{
step: 'When I click object from main page',
regExp: _r(`When I click ${pageObject}`),
result: `//div[@id='${realId}' and not(ancestor-or-self::*[contains(@style,"visibility: hidden;") ` +
'or contains(@style,"display: none;") or contains(@class,"x-hide-offsets")])]'
result: `//div[@id='${realId}' and not(ancestor-or-self::*[contains(@style,"visibility: hidden") ` +
Copy link
Member

Choose a reason for hiding this comment

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

Let's not remove semicolons from CSS "visibility: hidden;"

'or contains(@style,"display: none") or contains(@class,"x-hide-offsets")])]'
}
]

Expand All @@ -66,9 +66,9 @@ describe('getPageObject', () => {

expect(pageObjectVal).to.be.equals(result)
next()
});
});
});
})
})
})

describe('getDictionaryObject', () => {
const data = [
Expand Down Expand Up @@ -96,6 +96,6 @@ describe('getDictionaryObject', () => {

expect(dictionaryObjectVal).to.be.equals(result)
next()
});
});
});
})
})
})