-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
puppeteer tests working, fixed redundant client socket listeners (wow
package-lock.json)
- Loading branch information
Showing
8 changed files
with
2,301 additions
and
165 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
let browser; | ||
beforeAll(async () => { | ||
browser = await require('puppeteer').launch({ | ||
headless: false, | ||
executablePath: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe' | ||
}); | ||
}); | ||
|
||
const firstNickName = 'Billy'; | ||
const secondNickName = 'Jonana291'; | ||
|
||
// === // | ||
// e2e // | ||
// === // | ||
test('Cannot submit a blank nickname.', async () => { | ||
const inputSel = '#welcome form input'; | ||
|
||
const page = await browser.newPage(); | ||
await page.goto('localhost:3000'); | ||
|
||
// Input is blank | ||
expect(await page.$eval(inputSel, el => el.value)).toBe(""); | ||
|
||
// Submit | ||
await page.keyboard.press('Enter'); | ||
|
||
// Welcome page is still showing | ||
expect(await page.$('#games-browser')).toBeNull(); | ||
expect(await page.$('#welcome')).toBeTruthy(); | ||
|
||
// Input is focused | ||
const focusedElHandle = await page.evaluateHandle(() => document.activeElement) | ||
expect(await page.evaluate(el => el === document.activeElement, focusedElHandle)).toBe(true); | ||
|
||
browser.close(); | ||
}); |
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
Oops, something went wrong.