fix tests
This commit is contained in:
parent
9c14a0abd5
commit
6dfa63ba48
|
@ -79,7 +79,7 @@ async function main () {
|
||||||
await waitForMastodonUiToStart()
|
await waitForMastodonUiToStart()
|
||||||
}
|
}
|
||||||
|
|
||||||
function shutdownMastodon() {
|
function shutdownMastodon () {
|
||||||
if (childProc) {
|
if (childProc) {
|
||||||
console.log('killing child process')
|
console.log('killing child process')
|
||||||
childProc.kill()
|
childProc.kill()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import { getUrl, settingsButton } from '../utils'
|
import { getUrl, logInToInstanceLink, settingsButton } from '../utils'
|
||||||
|
|
||||||
fixture`001-basic-spec.js`
|
fixture`001-basic-spec.js`
|
||||||
.page`http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
@ -19,7 +19,7 @@ test('navigates to about', async t => {
|
||||||
})
|
})
|
||||||
|
|
||||||
test('navigates to /settings/instances/add', async t => {
|
test('navigates to /settings/instances/add', async t => {
|
||||||
await t.click($('a').withText('log in to an instance'))
|
await t.click(logInToInstanceLink)
|
||||||
.expect(getUrl()).contains('/settings/instances/add')
|
.expect(getUrl()).contains('/settings/instances/add')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import {
|
import {
|
||||||
authorizeInput, emailInput, formError, getFirstVisibleStatus, getUrl, instanceInput, passwordInput,
|
authorizeInput, emailInput, formError, getFirstVisibleStatus, getUrl, instanceInput, logInToInstanceLink,
|
||||||
|
passwordInput,
|
||||||
settingsButton
|
settingsButton
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ fixture`002-login-spec.js`
|
||||||
.page`http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
function manualLogin (t, username, password) {
|
function manualLogin (t, username, password) {
|
||||||
return t.click($('a').withText('log in to an instance'))
|
return t.click(logInToInstanceLink)
|
||||||
.expect(getUrl()).contains('/settings/instances/add')
|
.expect(getUrl()).contains('/settings/instances/add')
|
||||||
.typeText(instanceInput, 'localhost:3000')
|
.typeText(instanceInput, 'localhost:3000')
|
||||||
.pressKey('enter')
|
.pressKey('enter')
|
||||||
|
@ -22,7 +23,7 @@ function manualLogin (t, username, password) {
|
||||||
}
|
}
|
||||||
|
|
||||||
test('Cannot log in to a fake instance', async t => {
|
test('Cannot log in to a fake instance', async t => {
|
||||||
await t.click($('a').withText('log in to an instance'))
|
await t.click(logInToInstanceLink)
|
||||||
.expect(getUrl()).contains('/settings/instances/add')
|
.expect(getUrl()).contains('/settings/instances/add')
|
||||||
.typeText(instanceInput, 'fake.nolanlawson.com', {paste: true})
|
.typeText(instanceInput, 'fake.nolanlawson.com', {paste: true})
|
||||||
.pressKey('enter')
|
.pressKey('enter')
|
||||||
|
|
|
@ -22,6 +22,7 @@ export const contentWarningButton = $('.compose-box-toolbar button:nth-child(4)'
|
||||||
export const emailInput = $('input#user_email')
|
export const emailInput = $('input#user_email')
|
||||||
export const passwordInput = $('input#user_password')
|
export const passwordInput = $('input#user_password')
|
||||||
export const authorizeInput = $('button[type=submit]:not(.negative)')
|
export const authorizeInput = $('button[type=submit]:not(.negative)')
|
||||||
|
export const logInToInstanceLink = $('a[href="/settings/instances/add"]')
|
||||||
|
|
||||||
export const favoritesCountElement = $('.status-favs-reblogs:nth-child(3)').addCustomDOMProperties({
|
export const favoritesCountElement = $('.status-favs-reblogs:nth-child(3)').addCustomDOMProperties({
|
||||||
innerCount: el => parseInt(el.innerText, 10)
|
innerCount: el => parseInt(el.innerText, 10)
|
||||||
|
|
Loading…
Reference in a new issue