1 | * [I am on the "\_\_\_" page](i-am-on-the-"\_\_\_"-page)
|
2 | * [regex](regex)
|
3 | * [execution](execution)
|
4 | # I am on the "\_\_\_" page
|
5 | ## regex
|
6 | regex should match "I am on..."
|
7 |
|
8 | ```
|
9 | return verifyStepMatch('I am on the "Test" page');
|
10 | ```
|
11 |
|
12 |
|
13 | regex should match "I go to..."
|
14 |
|
15 | ```
|
16 | return verifyStepMatch('I go to the "Test" page');
|
17 | ```
|
18 |
|
19 |
|
20 | regex should not capture "am on"
|
21 |
|
22 | ```
|
23 | return verifyStepDoesNotCapture('I am on the "Test" page', 'am on');
|
24 | ```
|
25 |
|
26 |
|
27 | regex should capture the page name
|
28 |
|
29 | ```
|
30 | return verifyStepCaptures('I go to the "Test" page', 'Test');
|
31 | ```
|
32 |
|
33 |
|
34 | ## execution
|
35 | execution should set the currentPage on the World
|
36 |
|
37 | ```
|
38 | return executeStep('I am on the "Test" page', function() {
|
39 | expect(world.currentPage).to.equal(stubPage);
|
40 | });
|
41 | ```
|
42 |
|
43 |
|
44 | execution should call get on the page
|
45 |
|
46 | ```
|
47 | return executeStep('I am on the "Test" page', function() {
|
48 | expect(stubPage.get.calledOnce).to.equal(true);
|
49 | });
|
50 | ```
|
51 |
|
52 |
|
53 | execution should call waitForLoaded on the page
|
54 |
|
55 | ```
|
56 | return executeStep('I am on the "Test" page', function() {
|
57 | expect(stubPage.waitForLoaded.calledOnce).to.equal(true);
|
58 | });
|
59 | ```
|
60 |
|
61 |
|
62 | execution should provide a clear error message if the Page Object was not added to the PageObjectMap
|
63 |
|
64 | ```
|
65 | return executeStep('I am on the "Missing" page', function() {
|
66 | expect(currentStepResult.failureException.toString()).to.equal("Error: Could not find page with name 'Missing' in the PageObjectMap, did you remember to add it?");
|
67 | });
|
68 | ```
|