Regression Test login user and fill the form (browser)

'use strict'

const { test, trait } = use('Test/Suite')('Posts')
const Factory = use('Factory')
const User = use('App/Models/User')


test('Error if user didnt enter data', async ({ assert, browser }) => {

  const user = await Factory.model('App/Models/User').create()

  const page = await browser.visit('/post/new', (request) => {

  await page.assertPath('/post/new')

  await page
  .type('input[name="name"]', '')
  .select('[name="topic"]', 'Questions')

  await page.assertPath('/posts')

above code returns this:

1. Error if user didnt enter data
  TypeError: Cannot read property 'type' of null
    at Page.type (/home/usr/node/forum/node_modules/puppeteer/lib/Page.js:798:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

On other pages where no login is needed page.type() works fine. I feel like it doesn’t see the form…
if I remove .type property it complains about select property

Error: Error: failed to find element matching selector "[name="topic"]"

Any ideas? :S

Nevermind! I didn’t seed the database. Page.getHtml() was showing there was no content thus it couldn’t find the right element!