|
1 | 1 | import { test, useWebdriver } from '../helpers/webdriver'; |
2 | 2 | import { setTemporaryRecordingPath } from '../helpers/modules/settings/settings'; |
3 | | -import { click, clickButton, focusMain, select, waitForDisplayed } from '../helpers/modules/core'; |
| 3 | +import { clickButton, focusMain, isDisplayed, waitForDisplayed } from '../helpers/modules/core'; |
4 | 4 | import { showPage } from '../helpers/modules/navigation'; |
5 | 5 | import { |
| 6 | + clickGoLive, |
6 | 7 | prepareToGoLive, |
7 | 8 | stopStream, |
8 | 9 | tryToGoLive, |
| 10 | + waitForSettingsWindowLoaded, |
9 | 11 | waitForStreamStart, |
10 | 12 | } from '../helpers/modules/streaming'; |
11 | 13 | import { logIn } from '../helpers/modules/user'; |
12 | 14 | import { saveReplayBuffer } from '../helpers/modules/replay-buffer'; |
13 | | -import { assertFormContains, fillForm } from '../helpers/modules/forms'; |
| 15 | +import { fillForm } from '../helpers/modules/forms'; |
14 | 16 | import { withUser } from '../helpers/webdriver/user'; |
15 | 17 | const path = require('path'); |
16 | 18 | const fs = require('fs'); |
17 | 19 |
|
| 20 | +// not a react hook |
| 21 | +// eslint-disable-next-line react-hooks/rules-of-hooks |
18 | 22 | useWebdriver(); |
19 | 23 |
|
20 | 24 | test('Highlighter save and export', async t => { |
@@ -45,11 +49,53 @@ test('Highlighter save and export', async t => { |
45 | 49 | t.true(fs.existsSync(exportLocation), 'The video file should exist'); |
46 | 50 | }); |
47 | 51 |
|
48 | | -test.skip('AI Highlighter', withUser('twitch', { prime: true }), async t => { |
49 | | - const recordingDir = await setTemporaryRecordingPath(); |
50 | | - |
| 52 | +test('AI Highlighter', withUser('twitch', { prime: true }), async t => { |
| 53 | + // AI Highlighter install button shows |
51 | 54 | await showPage('Highlighter'); |
52 | | - await clickButton('Install AI Highlighter App'); |
| 55 | + await waitForDisplayed('[name="installHighlighter"]'); |
53 | 56 |
|
| 57 | + // Go live with AI Highlighter enabled |
54 | 58 | await prepareToGoLive(); |
| 59 | + await clickGoLive(); |
| 60 | + await waitForSettingsWindowLoaded(); |
| 61 | + |
| 62 | + await fillForm({ |
| 63 | + title: 'Test stream', |
| 64 | + twitchGame: 'Fortnite', |
| 65 | + }); |
| 66 | + |
| 67 | + // Highlighter div shows |
| 68 | + await waitForSettingsWindowLoaded(); |
| 69 | + t.true( |
| 70 | + await isDisplayed('[name="install-highlighter"]'), |
| 71 | + 'Case 1: Highlighter card should show for supported game', |
| 72 | + ); |
| 73 | + |
| 74 | + // Highlighter div hides |
| 75 | + await fillForm({ |
| 76 | + twitchGame: 'DOOM', |
| 77 | + }); |
| 78 | + await waitForSettingsWindowLoaded(); |
| 79 | + t.false( |
| 80 | + await isDisplayed('[name="install-highlighter"]'), |
| 81 | + 'Case 2: Highlighter card should hide for not supported game', |
| 82 | + ); |
| 83 | + |
| 84 | + // Highlighter div shows again |
| 85 | + await fillForm({ |
| 86 | + twitchGame: 'Fortnite', |
| 87 | + }); |
| 88 | + await waitForSettingsWindowLoaded(); |
| 89 | + t.true( |
| 90 | + await isDisplayed('[name="install-highlighter"]'), |
| 91 | + 'Case 3: Highlighter card should show when changing from an unsupported game to a supported game', |
| 92 | + ); |
| 93 | + await clickButton('Close'); |
| 94 | + await clickGoLive(); |
| 95 | + await waitForSettingsWindowLoaded(); |
| 96 | + t.true( |
| 97 | + await isDisplayed('[name="install-highlighter"]'), |
| 98 | + 'Case 5: Highlighter card should show for supported game when opening go live window', |
| 99 | + ); |
| 100 | + await clickButton('Close'); |
55 | 101 | }); |
0 commit comments