import {expect} from 'chai'

fixture `mn-input`
  .page('http://localhost:3000/demo.html')
  // .beforeEach(async page => await page.wait(5000))

test('type value', async page => {
  await page.typeText('#username', 'John Snow')
  await page.typeText('#password', 'loveygrit')
  await page.typeText('#email', 'john@snow.com')

  const username = await page.select('#username')
  const password = await page.select('#password')
  const email = await page.select('#email')

  expect(username.value).to.equal('John Snow')
  expect(password.value).to.equal('loveygrit')
  expect(email.value).to.equal('john@snow.com')
})

test('set value', async page => {
  const username = await page.select('#username')
  const password = await page.select('#password')
  const email = await page.select('#email')

  username.value = 'John Snow'
  password.value = 'loveygrit'
  email.value = 'john@snow.com'

  expect(username.value).to.equal('John Snow')
  expect(password.value).to.equal('loveygrit')
  expect(email.value).to.equal('john@snow.com')
})

@@ -20,16 +20,50 @@
 m 'chai'
+%0Aimport %7BSelector%7D from 'testcafe'
 %0A%0Afixtur
@@ -122,60 +122,646 @@
 l')%0A
-  // .beforeEach(async page =%3E await page.wait(5000)
+%0Atest('is visible', async page =%3E %7B%0A  const username = await page.select('#username')%0A  const password = await page.select('#password')%0A  const email = await page.select('#email')%0A%0A  expect(username.visible).to.be.true%0A  expect(password.visible).to.be.true%0A  expect(email.visible).to.be.true%0A%7D)%0A%0Atest('display a placeholder', async page =%3E %7B%0A  const username = await page.select('#username')%0A  const password = await page.select('#password')%0A  const email = await page.select('#email')%0A%0A  expect(username.textContent).to.equal('username')%0A  expect(password.textContent).to.equal('password')%0A  expect(email.textContent).to.equal('email')%0A%7D
 )%0A%0At

add specs to vibility of element and placeholder