You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: general/development/tools/generator.md
+25-9
Original file line number
Diff line number
Diff line change
@@ -44,23 +44,39 @@ Before executing the behat generators, you need a `feature` file you want to exe
44
44
45
45
The tool does not use `selenium` or any other browser wrapper. It reads the feature file and executes specific steps in it.
46
46
47
+
This means:
48
+
49
+
1. The tool will only execute a few steps, which are generators and set config values. If any other type of step is present in the `feature` file, it will show a parsing error.
50
+
1. For now, the tool can only execute normal scenarios. It does not support background, or outline scenarios.
51
+
47
52
:::
48
53
49
-
This means:
54
+
:::tip Example
50
55
51
-
1. The tool will only execute generator steps. If any other type of step is present in the `feature` file, it will show a parsing error.
52
-
1. For now, the tool can only execute normal scenarios. It does not support background, outline, or scenario outline scenarios.
56
+
Some example Behat generator files can be found in [`admin/tool/generator/tests/fixtures/`](https://github.com/moodle/moodle/blob/main/admin/tool/generator/tests/fixtures/). For instance, [`testscenario/scenario.feature`](https://github.com/moodle/moodle/blob/main/admin/tool/generator/tests/fixtures/testscenario/scenario.feature) creates a course with two assignment activities and enrols one teacher along with five students.
57
+
58
+
:::
53
59
54
-
To execute the behat generators via the web interface, go to `Site administration > Development > Create testing scenarios`. Once there, you can upload the `feature`file you want to execute and see the the execution results.
60
+
### Execute a testing scenario behat file
55
61
56
-
To execute the behat generators via CLI, you can use the following command:
62
+
Before running a testing scenario, you need to install all behat dependencies. If you already execute some behat on the instance you can skip this step. Otherwise, you need to install the dependencies by running the following command:
There are two ways to run a testing scenario using a behat file: via the web interface or the CLI.
63
69
64
-
Some example Behat generator files can be found in [`admin/tool/generator/tests/fixtures/`](https://github.com/moodle/moodle/blob/main/admin/tool/generator/tests/fixtures/). For instance, [`testscenario/scenario.feature`](https://github.com/moodle/moodle/blob/main/admin/tool/generator/tests/fixtures/testscenario/scenario.feature) creates a course with two assignment activities and enrols one teacher along with five students.
70
+
To run via web interface:
65
71
66
-
:::
72
+
1. Go to `Site administration > Development > Create testing scenarios`.
73
+
1. Upload the `feature` file you want to execute and submit the form.
74
+
75
+
To run via CLI:
76
+
77
+
1. Copy the `feature` file you want to execute to some server location. You will need the full path to the file.
0 commit comments