Parameter restart not working in CodeceptJs with Playwright

Đang mở
#2,992 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
32/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js, playwright
Lĩnh vực
testing

Hướng nghiên cứu

Issue cung cấp một cấu hình helper của Playwright, nhưng không nêu tên file nguồn hoặc test nào. Hãy bắt đầu bằng cách tái hiện kịch bản với restart:false và keepBrowserState:true trên các phiên bản CodeceptJS, Node.js và Playwright được báo cáo; được xem là hoàn tất khi giải thích và khắc phục được việc trình duyệt liên tục khởi động lại, đồng thời có coverage hồi quy cho hành vi khởi động lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
    }
  }
}
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
756
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeceptjs/CodeceptJS

Tất cả issue của codeceptjs/CodeceptJS

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.