Created
February 21, 2020 07:39
-
-
Save mpg-tomoya-komiyama/c8aa813f3ce65b55352e7726d4f39aa6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector } from 'testcafe' | |
function isWin() { | |
return process.platform.startsWith('win') | |
} | |
// IE11は画面内に要素が収まっていないと反応しないのでリサイズする | |
// macなどGUI環境だとwindow以上に大きくするとエラーになるのでwin環境に限定する | |
async function resizeWindow(t) { | |
if (isWin()) await t.resizeWindow(5000, 2000) | |
} | |
fixture`トップ画面から応募まで`.page`0.0.0.0:8080/`.beforeEach(async (t) => { | |
await resizeWindow(t) | |
}) | |
test('PCトップ画面 -> 求人一覧画面', async (t) => { | |
await t | |
.click(Selector('button').withText('を表示する')) | |
.expect(getHref()) | |
.contains('offers') | |
await t | |
.click(Selector('button').withText('詳細を見る')) | |
.expect(Selector('button').withText('応募する').exists) | |
.ok() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment