-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for the guide and api_reference pages.
Replace text in Call to action button and point it to the guide page.
- Loading branch information
1 parent
51656eb
commit b29405e
Showing
8 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = class CustomPause { | ||
command(ms, cb) { | ||
// If we don't pass the milliseconds, the client will | ||
// be suspended indefinitely | ||
if (!ms) { | ||
return; | ||
} | ||
|
||
const returnValue = { | ||
value: 'something' | ||
}; | ||
|
||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
// if we have a callback, call it right before the complete event | ||
if (cb) { | ||
cb.call(this.api); | ||
} | ||
|
||
resolve(returnValue); | ||
}, ms); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
name: "${project_name}" | ||
}; |
6 changes: 6 additions & 0 deletions
6
templates/default/test/page-objects/api_reference/configuration.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
url: "/api_reference/configuration/index.html", | ||
elements: { | ||
exampleCode: "h2 code", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
url: "/guide/index.html", | ||
elements: { | ||
rightSidebar: '#right-sidebar', | ||
part1Heading: { | ||
selector: '//h2[text()="Part 1"]', | ||
locateStrategy: 'xpath' | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
describe("api_reference page", function () { | ||
test("configuration example is present", function (browser) { | ||
const configuration = browser.page.api_reference.configuration(); | ||
|
||
configuration.navigate().assert.visible("@exampleCode"); | ||
|
||
browser.end(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
describe('guide page', function () { | ||
test('right sidebar is visible', function (browser) { | ||
const guide = browser.page.guide(); | ||
|
||
guide | ||
.navigate() | ||
.assert.visible('@rightSidebar'); | ||
|
||
browser.end(); | ||
}); | ||
|
||
test('second heading is visible', function (browser) { | ||
const guide = browser.page.guide(); | ||
|
||
guide | ||
.navigate() | ||
.assert.visible('@part1Heading'); | ||
|
||
browser.end(); | ||
}); | ||
}); |