Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
testcafe-member-login
import { Selector } from 'testcafe';
fixture `會員中心`.page `Google 表單的網址`;
test('用表單模擬會員登入', async t => {
await t
.typeText('[name="entry.xxxxxxxx"]', 'https://letswrite.tw/')
.typeText('[name="entry.xxxxxxxx"]', 'Lets Write')
.click('[jsname="xxxxxxxx"]');
const msgEl = Selector('.freebirdFormviewerViewResponseConfirmationMessage');
const msg = msgEl.innerText;
await t.expect(msg).eql('我們已經收到您回覆的表單。');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment