Skip to content

Commit c3a08f7

Browse files
author
Ben Monro
committed
chore: tests for refresh
1 parent f9fd69f commit c3a08f7

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

test-app/page2.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<div>second page</div>
1+
<div>
2+
<h2>second page</h2>
3+
</div>
24
<section>
35
<section>
46
<h2>configure</h2>

tests/nightwatch/index.test.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = {
3333

3434
},
3535

36+
3637
async 'getByLabelText'(browser) {
3738
const { getByLabelText } = getQueriesFrom(browser);
3839
const input = await getByLabelText('Label For Input Labelled By Id');
@@ -94,7 +95,29 @@ module.exports = {
9495
browser.assert.elementNotPresent(nonExistentButtons);
9596

9697

97-
}
98+
},
99+
100+
async 'still works after page navigation'(browser) {
101+
const { getByText } = getQueriesFrom(browser);
102+
103+
const page2 = await getByText('Go to Page 2');
104+
105+
browser.click(page2);
106+
107+
browser.expect.element(await getByText('second page')).to.be.present;
108+
},
109+
110+
async 'still works after refresh'(browser) {
111+
const { getByText } = getQueriesFrom(browser);
112+
113+
browser.click(await getByText('Go to Page 2'));
114+
115+
browser.back();
116+
browser.refresh();
117+
118+
browser.expect.element(await getByText('getByText')).to.be.present;
119+
},
120+
98121

99122

100123

0 commit comments

Comments
 (0)