i have problem when i try to run yamal file on github actions its stuck on : Error: Process completed with exit code 1.
i have this yaml file code :
on:
push:
branches:
- develop
jobs:
npm_install_and_run_tests:
name: Install dependencies and run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install backend dependencies
run: npm --prefix ./backend/ install
- name: Install frontend dependencies
run: npm --prefix ./frontend/ install
- name: Install Google Chrome
run: sudo apt-get install -y google-chrome-stable
# - name: Start the backend
# run: npm --prefix ./backend/ start &
# - name: Start the frontend
# run: npm --prefix ./frontend/ start &
# - name: Wait for servers to be ready
# run: sleep 10
- name: Run all tests
run: npm --prefix ./frontend/ run navbarTest
and this the test code :
const { Builder, By, until, Browser } = require('selenium-webdriver');
const assert = require('assert');
describe("NavBar test", function () {
this.timeout(100000);
it("NavBar", async function () {
let driver = await new Builder().forBrowser(Browser.CHROME).build();
await driver.get('https://itstore-main-fe-omj2.onrender.com/');
await driver.sleep(1000); // Add delay to observe page loading
await driver.findElement(By.linkText('About')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Product')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Login')).click();
await driver.sleep(1000)
await driver.findElement(By.linkText('Register')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Stav')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Adar')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Ido')).click();
await driver.sleep(1000);
await driver.findElement(By.className('cart')).click();
await driver.sleep(1000);
await driver.findElement(By.linkText('Home')).click();
await driver.sleep(1000);
const currentUrl = await driver.getCurrentUrl();
assert.equal(currentUrl, 'https://itstore-main-fe-omj2.onrender.com/', 'Expected URL does not match actual URL');
await driver.quit();
});
});
when i deploy this on github i get this eror :
- NavBar test
NavBar:
SessionNotCreatedError: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn’t exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:521:15)
at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:514:13)
at Executor.execute (node_modules/selenium-webdriver/lib/http.js:446:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
any one know why its not work ??? i try a lot of things and still its not open chrome i try also firefox and any other web browser please help me
i try to run on another web browser and another way to install chrome and i didnt get this please help me