artes 1.0.29 → 1.0.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "The package provide step definitions and user writes feature files, and the package handles automation, with optional POM files and custom step definitions.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  const { When, context, selector } = require("../helper/imports/commons");
2
- const { page, assert } = require("../helper/stepFunctions/exporter");
2
+ const { page, assert, mouse } = require("../helper/stepFunctions/exporter");
3
3
 
4
4
  When("User navigates to {string} page", async function (url) {
5
5
  const URL = await selector(url);
@@ -38,3 +38,32 @@ When(`User waits {int} milliseconds`, async (sec) => {
38
38
  When(`User waits {int} minutes`, async (sec) => {
39
39
  await page.wait(sec * 1000 * 60);
40
40
  });
41
+
42
+
43
+ When('User clicks {string} and confirms alert', async (button) => {
44
+ context.page.on('dialog', async (dialog) => {
45
+ await dialog.accept();
46
+ });
47
+ await mouse.click(button);
48
+ });
49
+
50
+ When('User clicks {string} and confirms popup', async (button) => {
51
+ context.page.on('dialog', async (dialog) => {
52
+ await dialog.accept();
53
+ });
54
+ await mouse.click(button);
55
+ });
56
+
57
+ When('User clicks {string} and dismisses popup', async (button) => {
58
+ context.page.on('dialog', async (dialog) => {
59
+ await dialog.dismiss();
60
+ });
61
+ await mouse.click(button);
62
+ });
63
+
64
+ When('User clicks {string} and types {string} in prompt', async (button, prompt) => {
65
+ context.page.on('dialog', async (dialog) => {
66
+ await dialog.accept(prompt);
67
+ });
68
+ await mouse.click(button);
69
+ });