mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-11-10 05:34:44 +00:00
temp fix issue with root user
This commit is contained in:
parent
274a05fdc2
commit
ef5dccfd1a
@ -9,14 +9,23 @@ describe("test App end to end", async () => {
|
||||
let page;
|
||||
|
||||
before(async () => {
|
||||
browser = await puppeteer.launch();
|
||||
page = await browser.newPage();
|
||||
try{
|
||||
await page.goto("http://localhost:8080", {timeout: 5000});
|
||||
let root;
|
||||
try {
|
||||
root = process.getuid() == 0;
|
||||
}
|
||||
catch (error) {
|
||||
console.log("❌ failed to connect to localhost webserver on port 8080");
|
||||
exit(1);
|
||||
root = false;
|
||||
}
|
||||
|
||||
browser = await puppeteer.launch({args: root ? ['--no-sandbox'] : undefined});
|
||||
page = await browser.newPage();
|
||||
try{
|
||||
await page.goto("http://localhost:8080", {timeout: 1000});
|
||||
await console.log(`✔ connected to localhost webserver as ${root ? "root" : "user"}`);
|
||||
}
|
||||
catch (error) {
|
||||
await console.log("❌ failed to connect to localhost webserver on port 8080");
|
||||
await exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user