UNPKG

1.43 kBMarkdownView Raw
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```
9return verifyStepMatch('I am on the "Test" page');
10```
11
12
13 regex should match "I go to..."
14
15```
16return verifyStepMatch('I go to the "Test" page');
17```
18
19
20 regex should not capture "am on"
21
22```
23return verifyStepDoesNotCapture('I am on the "Test" page', 'am on');
24```
25
26
27 regex should capture the page name
28
29```
30return verifyStepCaptures('I go to the "Test" page', 'Test');
31```
32
33
34## execution
35 execution should set the currentPage on the World
36
37```
38return 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```
47return 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```
56return 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```
65return 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```