Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use socket to communicate between cli and test
- Loading branch information
Showing
2 changed files
with
61 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const qawolf = require('qawolf'); | ||
const { TEST_URL } = require('./utils'); | ||
|
||
const net = require('net'); | ||
|
||
console.log(process.env.EDIT_PORT); | ||
|
||
const client = net.createConnection( | ||
{ port: Number(process.env.EDIT_PORT) }, | ||
() => { | ||
console.log('CLIENT: I connected to the server.'); | ||
client.write('CLIENT: Hello this is client!'); | ||
}, | ||
); | ||
|
||
client.on('data', (data) => { | ||
console.log(data.toString()); | ||
client.end(); | ||
}); | ||
|
||
client.on('end', () => { | ||
console.log('CLIENT: I disconnected from the server.'); | ||
}); | ||
|
||
let browser; | ||
let page; | ||
|
||
beforeAll(async () => { | ||
browser = await qawolf.launch(); | ||
const context = await browser.newContext(); | ||
await qawolf.register(context); | ||
page = await context.newPage(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await qawolf.stopVideos(); | ||
await browser.close(); | ||
}); | ||
|
||
test('edit', async () => { | ||
await new Promise(() => {}); | ||
}); |