@bucky24/jsbehave 0.12.1 → 0.12.3

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/README.md CHANGED
@@ -53,7 +53,7 @@ Running `jsbehave` directly will locate all files that end in `.behave` and will
53
53
 
54
54
  `set active browser to <name>`
55
55
 
56
- `expect element <selector> to have contents <text>`
56
+ `expect element <selector> to have content <text>`
57
57
 
58
58
  `set variable <variable name> to <text>`
59
59
 
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@bucky24/jsbehave",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "A module that allows BDD testing for browser based testing in Selenium.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
- "test": "node src/index.js examples/basic_example",
8
- "browserTest": "node src/index.js examples/browser_example",
9
- "screenshotTest": "node src/index.js examples/screenshot_example",
10
- "actionTest": "node src/index.js examples/action_example",
11
- "publish": "npm publish --access=public"
7
+ "test": "node src/index.js examples/basic_example.behave",
8
+ "browserTest": "node src/index.js examples/browser_example.behave",
9
+ "screenshotTest": "node src/index.js examples/screenshot_example.behave",
10
+ "actionTest": "node src/index.js examples/action_example.behave"
12
11
  },
13
12
  "repository": {
14
13
  "type": "git",
@@ -31,8 +30,7 @@
31
30
  },
32
31
  "homepage": "https://github.com/Bucky24/jsbehave#readme",
33
32
  "dependencies": {
34
- "clipboardy": "^2.3.0",
35
- "selenium-webdriver": "4.3.1",
36
- "uuid": "^8.3.2"
33
+ "clipboardy": "^5.3.1",
34
+ "selenium-webdriver": "4.41.0"
37
35
  }
38
36
  }
package/src/index.js CHANGED
@@ -4,8 +4,9 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
4
4
  const fs = require("fs");
5
5
  const { EOL } = require('os');
6
6
  const path = require("path");
7
- const clipboardy = require('clipboardy');
8
- const { v4: uuidv4 } = require('uuid');
7
+ const { randomUUID } = require('crypto');
8
+ let clipboardy;
9
+ import('clipboardy').then((c) => clipboardy = c);
9
10
 
10
11
  let fileNames = [];
11
12
  if (process.argv.length > 2) {
@@ -143,7 +144,7 @@ function getText(string, allowRegex) {
143
144
  regexStr = regexStr.substr(0, regexStr.length-1)
144
145
  string = new RegExp(regexStr);
145
146
  } else if (string === "uuid") {
146
- string = uuidv4();
147
+ string = randomUUID();
147
148
  }
148
149
 
149
150
  return string;
@@ -378,13 +379,19 @@ function closeBrowserWithName([ name ]) {
378
379
  async function compareContent([ selector, text ]) {
379
380
  const sel = getSelector(selector);
380
381
  const elem = await driver().findElement(sel);
381
- text = getText(text);
382
+ text = getText(text, true);
382
383
  const html = await elem.getAttribute('innerHTML');
384
+ if (text instanceof RegExp && text.test(html)) {
385
+ return;
386
+ }
383
387
  if (html === text) {
384
388
  return;
385
389
  }
386
390
 
387
391
  const value = await elem.getAttribute('value');
392
+ if (text instanceof RegExp && text.test(value)) {
393
+ return;
394
+ }
388
395
  if (value === text) {
389
396
  return;
390
397
  }