我有一個通過 test cafe studio 運行的測試,該測試進入網站,點擊頁面并暫停。在暫停期間,我希望彈出一個消息框并顯示一條評論(用作解釋網站上發生的事情的教學工具)。我已經嘗試了幾種選擇,但它們都不起作用。我對此很陌生,可能會遺漏一些東西?提前致謝!這是我的簡單測試代碼import { Selector, ClientFunction } from 'testcafe'; 從“彈出窗口”導入{彈出窗口};夾具svdemo manager cockpit 。第http://localhost/SvManagerCockpit/home .httpAuth({用戶名: 'myusernamehere',密碼: 'mypasswordhere',域: 'mydomainhere'});test('Pause', async t => { await t .click(Selector('span').withText('Machine OEE Dashboard')) .wait(10000); popup.alert({ content: 'Hello!' } ); 返回 1; });await t .expect(alert()).eql(1);}); 我希望在 .js 測試中插入一些代碼以在瀏覽器中生成一個消息框/對話框。
測試期間彈出消息框
精慕HU
2021-08-20 18:08:27