codeceptjs 4.0.0-beta.6.esm-aria → 4.0.0-beta.7.esm-aria
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/helper/WebDriver.js +18 -17
- package/package.json +3 -6
- package/translations/utils.js +2 -10
package/lib/helper/WebDriver.js
CHANGED
|
@@ -2880,20 +2880,20 @@ async function findClickable(locator, locateFn) {
|
|
|
2880
2880
|
els = await locateFn(Locator.clickable.narrow(literal))
|
|
2881
2881
|
if (els.length) return els
|
|
2882
2882
|
|
|
2883
|
-
els = await locateFn(Locator.clickable.wide(literal))
|
|
2884
|
-
if (els.length) return els
|
|
2885
|
-
|
|
2886
|
-
els = await locateFn(Locator.clickable.self(literal))
|
|
2887
|
-
if (els.length) return els
|
|
2888
|
-
|
|
2889
2883
|
// Try ARIA selector for accessible name
|
|
2890
2884
|
try {
|
|
2891
|
-
els = await
|
|
2885
|
+
els = await locateFn(`aria/${locator.value}`)
|
|
2892
2886
|
if (els.length) return els
|
|
2893
2887
|
} catch (e) {
|
|
2894
2888
|
// ARIA selector not supported or failed
|
|
2895
2889
|
}
|
|
2896
2890
|
|
|
2891
|
+
els = await locateFn(Locator.clickable.wide(literal))
|
|
2892
|
+
if (els.length) return els
|
|
2893
|
+
|
|
2894
|
+
els = await locateFn(Locator.clickable.self(literal))
|
|
2895
|
+
if (els.length) return els
|
|
2896
|
+
|
|
2897
2897
|
return await locateFn(locator.value) // by css or xpath
|
|
2898
2898
|
}
|
|
2899
2899
|
|
|
@@ -2912,20 +2912,20 @@ async function findFields(locator) {
|
|
|
2912
2912
|
let els = await this._locate(Locator.field.labelEquals(literal))
|
|
2913
2913
|
if (els.length) return els
|
|
2914
2914
|
|
|
2915
|
-
els = await this._locate(Locator.field.labelContains(literal))
|
|
2916
|
-
if (els.length) return els
|
|
2917
|
-
|
|
2918
|
-
els = await this._locate(Locator.field.byName(literal))
|
|
2919
|
-
if (els.length) return els
|
|
2920
|
-
|
|
2921
2915
|
// Try ARIA selector for accessible name
|
|
2922
2916
|
try {
|
|
2923
|
-
els = await this.
|
|
2917
|
+
els = await this._locate(`aria/${locator.value}`)
|
|
2924
2918
|
if (els.length) return els
|
|
2925
2919
|
} catch (e) {
|
|
2926
2920
|
// ARIA selector not supported or failed
|
|
2927
2921
|
}
|
|
2928
2922
|
|
|
2923
|
+
els = await this._locate(Locator.field.labelContains(literal))
|
|
2924
|
+
if (els.length) return els
|
|
2925
|
+
|
|
2926
|
+
els = await this._locate(Locator.field.byName(literal))
|
|
2927
|
+
if (els.length) return els
|
|
2928
|
+
|
|
2929
2929
|
return await this._locate(locator.value) // by css or xpath
|
|
2930
2930
|
}
|
|
2931
2931
|
|
|
@@ -3066,17 +3066,18 @@ async function findCheckable(locator, locateFn) {
|
|
|
3066
3066
|
const literal = xpathLocator.literal(locator.value)
|
|
3067
3067
|
els = await locateFn(Locator.checkable.byText(literal))
|
|
3068
3068
|
if (els.length) return els
|
|
3069
|
-
els = await locateFn(Locator.checkable.byName(literal))
|
|
3070
|
-
if (els.length) return els
|
|
3071
3069
|
|
|
3072
3070
|
// Try ARIA selector for accessible name
|
|
3073
3071
|
try {
|
|
3074
|
-
els = await
|
|
3072
|
+
els = await locateFn(`aria/${locator.value}`)
|
|
3075
3073
|
if (els.length) return els
|
|
3076
3074
|
} catch (e) {
|
|
3077
3075
|
// ARIA selector not supported or failed
|
|
3078
3076
|
}
|
|
3079
3077
|
|
|
3078
|
+
els = await locateFn(Locator.checkable.byName(literal))
|
|
3079
|
+
if (els.length) return els
|
|
3080
|
+
|
|
3080
3081
|
return await locateFn(locator.value) // by css or xpath
|
|
3081
3082
|
}
|
|
3082
3083
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.7.esm-aria",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
6
6
|
"keywords": [
|
|
@@ -39,12 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"types": "typings/index.d.ts",
|
|
41
41
|
"bin": {
|
|
42
|
-
"codeceptjs": "bin/codecept.js"
|
|
43
|
-
},
|
|
44
|
-
"repository": {
|
|
45
|
-
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/Codeception/codeceptjs.git"
|
|
42
|
+
"codeceptjs": "./bin/codecept.js"
|
|
47
43
|
},
|
|
44
|
+
"repository": "Codeception/codeceptjs",
|
|
48
45
|
"scripts": {
|
|
49
46
|
"json-server": "json-server test/data/rest/db.json --host 0.0.0.0 -p 8010 --watch -m test/data/rest/headers.cjs",
|
|
50
47
|
"json-server:graphql": "node test/data/graphql/index.js",
|
package/translations/utils.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
import { dirname, join } from 'path'
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
6
|
-
const __dirname = dirname(__filename)
|
|
1
|
+
import { dialects } from '@cucumber/gherkin'
|
|
7
2
|
|
|
8
3
|
export function gherkinTranslations(langCode) {
|
|
9
|
-
|
|
10
|
-
const gherkinLanguagesPath = join(__dirname, '../node_modules/@cucumber/gherkin/src/gherkin-languages.json')
|
|
11
|
-
const gherkinLanguages = JSON.parse(readFileSync(gherkinLanguagesPath, 'utf8'))
|
|
12
|
-
const { feature, scenario, scenarioOutline } = gherkinLanguages[langCode]
|
|
4
|
+
const { feature, scenario, scenarioOutline } = dialects[langCode]
|
|
13
5
|
return {
|
|
14
6
|
Feature: feature[0],
|
|
15
7
|
Scenario: scenario[0],
|