Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Parameter restart not working in CodeceptJs with Playwright

Open
#2,992 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js, playwright
Domain
testing

Research direction

The issue provides a Playwright helper configuration but names no source file or test. Start by reproducing the scenario with restart:false and keepBrowserState:true on the reported CodeceptJS, Node.js, and Playwright versions; done means explaining and correcting the repeated browser restarts, with regression coverage for the restart behavior.

Written by the indexing model from the issue text.

Description

playwright
What are you trying to achieve?

I am using CodeceptJS + Playwright

I'm looking for a before all solution to open browser e execute some steps before scenarios but can't find anyone in codeceptjs+playwright. BeforeSuite can't access browser.

What do you get instead?

I tried to use restart:false to run all scenarios in same browser window but the browser is always restarted before each scenario.

I could see something strange....when using restart:false and test finish, browser close and then another instance browser is opened but closes again and finally open another instance and continue the scenarios.

This not happen when restart:true, browser close and open ok between scenarios.

Provide test source code if related

Here is my helper with restart parameter:

helpers: {
    Playwright: {
      show: true,
      browser: 'chromium',
      windowSize: '1280x960',
      waitForNavigation: "networkidle0",
      restart: false,
      keepBrowserState: true
    },
  },
Details
  • CodeceptJS version: 3.1.1
  • NodeJS Version: 14.9.0
  • Operating System: Windows
  • Playwright version: 1.14.0
  • Configuration file:
const dotenv = require('dotenv').config();

exports.config = {
  tests: './specs/site/*.js',
  output: './reports/e2esitecc',
  helpers: {
    Playwright: {
      show: true,
      browser: 'chromium',
      windowSize: '1280x960',
      waitForNavigation: "networkidle0",
      restart: false,
      keepBrowserState: true
    },
  },
  include: {
    I: './steps_file.js',
    testePage: './pages/testePage.js',
    loginPage: './pages/login_po.js',
  },
  bootstrap: null,
  mocha: {},
  name: 'e2e-web-codeceptjs',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    }
  }
}
Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.