Commit eb4ef544 authored by Arunoda Susiripala's avatar Arunoda Susiripala

Possible fix for dynamic import test in travis.

parent 737c283b
/* global describe, it, expect */ /* global describe, it, expect */
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
import { waitFor } from 'next-test-utils'
export default function (context) { export default function (context) {
describe('Render via browser', () => { describe('Render via browser', () => {
...@@ -95,9 +96,15 @@ export default function (context) { ...@@ -95,9 +96,15 @@ export default function (context) {
it('should render dynamic import components in the client', async () => { it('should render dynamic import components in the client', async () => {
const browser = await webdriver(context.port, '/') const browser = await webdriver(context.port, '/')
const text = await browser await browser
.elementByCss('#dynamic-imports-page').click() .elementByCss('#dynamic-imports-page').click()
.waitForElementByCss('#dynamic-imports-page') .waitForElementByCss('#dynamic-imports-page')
// Wait until browser loads the dynamic import chunk
// TODO: We may need to find a better way to do this
await waitFor(5000)
const text = await browser
.elementByCss('#dynamic-imports-page p').text() .elementByCss('#dynamic-imports-page p').text()
expect(text).toBe('Welcome to dynamic imports.') expect(text).toBe('Welcome to dynamic imports.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment