|
|
@@ -22,7 +22,6 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await advanced.select('.m-select', 'http')
|
|
|
await advanced.type('[type=text]', 'localhost:3000')
|
|
|
await advanced.click('button')
|
|
|
- // await advanced.waitFor(() => document.querySelectorAll('.m-list li').length === 2)
|
|
|
await advanced.waitFor(200)
|
|
|
|
|
|
// enable header detection
|
|
|
@@ -43,7 +42,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/correct-content-type')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -77,7 +76,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await content.bringToFront()
|
|
|
await popup.click('button:nth-of-type(1)')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor('#_markdown')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -121,7 +120,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/correct-content-type')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_theme')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -139,7 +138,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await content.bringToFront()
|
|
|
await popup.select('.m-panel:nth-of-type(1) select', 'github-dark')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor('#_theme')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -156,9 +155,6 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// reload popup
|
|
|
await popup.bringToFront()
|
|
|
await popup.reload()
|
|
|
-
|
|
|
- // TODO: wait for https://github.com/GoogleChrome/puppeteer/pull/2289
|
|
|
- // await popup.waitFor('#popup')
|
|
|
await popup.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
@@ -194,7 +190,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/compiler-options-marked')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -211,8 +207,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// gfm switch
|
|
|
await popup.click('.m-panel:nth-of-type(2) .m-switch:nth-of-type(2)')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor(100)
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -227,9 +222,6 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// reload popup
|
|
|
await popup.bringToFront()
|
|
|
await popup.reload()
|
|
|
-
|
|
|
- // TODO: wait for https://github.com/GoogleChrome/puppeteer/pull/2289
|
|
|
- // await popup.waitFor('#popup')
|
|
|
await popup.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
@@ -273,7 +265,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/compiler-options-remark')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -289,8 +281,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await content.bringToFront()
|
|
|
await popup.select('.m-panel:nth-of-type(2) select', 'remark')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor(100)
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -320,9 +311,6 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// redraw popup
|
|
|
await popup.bringToFront()
|
|
|
await popup.reload()
|
|
|
-
|
|
|
- // TODO: wait for https://github.com/GoogleChrome/puppeteer/pull/2289
|
|
|
- // await popup.waitFor('#popup')
|
|
|
await popup.waitFor(200)
|
|
|
|
|
|
// disable gfm
|
|
|
@@ -330,9 +318,6 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// gfm switch
|
|
|
await popup.click('.m-panel:nth-of-type(2) .m-switch:nth-of-type(4)')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor(100)
|
|
|
- // TODO: wait for https://github.com/GoogleChrome/puppeteer/pull/2289
|
|
|
- // await content.waitFor('#_html')
|
|
|
await content.waitFor(200)
|
|
|
|
|
|
t.equal(
|
|
|
@@ -348,13 +333,8 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// reload popup
|
|
|
await popup.bringToFront()
|
|
|
await popup.reload()
|
|
|
-
|
|
|
- // TODO: wait for https://github.com/GoogleChrome/puppeteer/pull/2289
|
|
|
- // await popup.waitFor('#popup')
|
|
|
await popup.waitFor(200)
|
|
|
|
|
|
- await popup.waitFor(100)
|
|
|
-
|
|
|
t.equal(
|
|
|
await popup.evaluate(() =>
|
|
|
document.querySelectorAll('.m-panel:nth-of-type(2) .m-select option')[
|
|
|
@@ -396,7 +376,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/content-options-toc')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -413,7 +393,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// toc switch
|
|
|
await popup.click('.m-panel:nth-of-type(3) .m-switch:nth-of-type(3)')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor('#_toc')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.deepStrictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -444,18 +424,17 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// go to page serving markdown as text/markdown
|
|
|
await content.goto('http://localhost:3000/content-options-scroll')
|
|
|
await content.bringToFront()
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
// scroll down 200px
|
|
|
await content.evaluate(() =>
|
|
|
document.querySelector('body').scrollTop = 200
|
|
|
)
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
// reload page
|
|
|
await content.reload()
|
|
|
- await content.waitFor('#_html')
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -472,8 +451,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
// scroll switch
|
|
|
await popup.click('.m-panel:nth-of-type(3) .m-switch:nth-of-type(2)')
|
|
|
// content auto reloads
|
|
|
- await content.waitFor(100)
|
|
|
- await content.waitFor('#_html')
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -487,12 +465,11 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await content.evaluate(() =>
|
|
|
document.querySelector('body').scrollTop = 200
|
|
|
)
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
// reload page
|
|
|
await content.reload()
|
|
|
- await content.waitFor('#_html')
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -506,7 +483,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
it('scroll to anchor', async () => {
|
|
|
// click on header link
|
|
|
await content.click('h2 a')
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -522,7 +499,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
await content.evaluate(() =>
|
|
|
document.querySelector('body').scrollTop += 200
|
|
|
)
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|
|
|
@@ -536,8 +513,7 @@ module.exports = ({popup, advanced, content}) => {
|
|
|
|
|
|
// reload page
|
|
|
await content.reload()
|
|
|
- await content.waitFor('#_html')
|
|
|
- await content.waitFor(150)
|
|
|
+ await content.waitFor(200)
|
|
|
|
|
|
t.strictEqual(
|
|
|
await content.evaluate(() =>
|