-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started Doc #37
Comments
Hello @ramyaa, thanks for creating this issue!. At the moment I don't have a getting started guide for this project, but that is definitely something that should be added. This module is designed to be easy to use. I wanted it to be simplistic, much like regular mocha, so things such as bundling are all handled for you. To start, just create a test file and maybe call it something like const assert = require('assert')
describe('my test', () => {
it('should pass', () => {
assert(1 + 1 === 2)
})
}) Afterwards, install The cli is quite different from regular mocha's cli, so I recommend checking the README to see what is supported. Let me know if you have any questions! |
Hi @charlieduong94 thanks for the explanation. Maybe im missing something very basic. when I do a " npx mocha-puppeteer test.js" - I see "Test server is listening on http://localhost:64594..." - What is this test server? describe('screenshot test', function () {
it('should take a screenshot', async () => {
await window.puppeteerCommand({
type: 'setViewport',
args: [ {width: 1600, height: 1200} ]
});
await window.puppeteerCommand({
type: 'goto',
args: [{url: 'http://localhost:3000'}]
})
})
}) I get an error "(node:95200) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Protocol error (Page.navigate): Invalid parameters url: string value expected" How can I navigate to http://localhost:3000 ? |
@ramyaa await window.puppeteerCommand({
type: 'goto',
args: ['http://localhost:3000']
}) |
Hi @austinkelleher that was what I tried firstly, but it didnt work. I got the following error: So I thought it must be a JSON. |
@ramyaa If you are looking for a way to run assertions based off of content running on another page, it might be better to use standard This module was designed to be somewhat of a replacement for |
I'll second the need for a getting started doc. My primary question is just how to ensure that the scripts I'm trying to test are loaded into Chromium, so that my tests can actually call the functions I define in my to-be-tested code. |
Hi
Is there a simple getting started guide which has a "hello world" sample to use this mocha-pupeeteer?
Thanks
Ramya
The text was updated successfully, but these errors were encountered: