overriding the configuration for the multi-session by passing a second parameter don't work

Đang mở
#4,401 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js, playwright
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu với hàm session và cấu hình helper của Playwright trong codecept.conf.ts, sau đó tái hiện ví dụ multi-session được cung cấp bằng tham số thứ hai. Theo dõi cách các tùy chọn session được kết hợp với cấu hình mặc định và xác minh rằng các thiết lập trình duyệt và thiết bị đã được ghi đè được sử dụng thay cho các giá trị mặc định.

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

Mô tả

stale
What are you trying to achieve?

I'm trying to override the configuration for multi-session by passing a second parameter to the session function. I want the configuration to apply the overridden settings, but it doesn't work as expected.

What do you get instead?

The overriding doesn't apply; the default configuration in codecept.conf.ts is still being applied.

Provide console output if related. Use --verbose mode for more details.

> crossdevices@1.0.0 codeceptjs
> codeceptjs run --verbose

***************************************
nodeInfo:  16.18.1
osInfo:  macOS 14.4
cpuInfo:  (8) arm64 Apple M2
chromeInfo:  126.0.6478.61
edgeInfo:  126.0.2592.61
firefoxInfo:  undefined
safariInfo:  17.4
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.6.3 #StandWithUkraine
Using test root "/Users/raspfr/repo/poc/crossdevices"
Helpers: Playwright
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement

login --
    [1]  Starting recording promises
    Timeouts: 
 › [Session] Starting singleton browser session
  test something
    I am on page "https://www.google.com"
    › [Browser:Error] Permissions policy violation: unload is not allowed in this document.
    I wait 5
 › [New Context] {"browser":"webkit","emulate":{"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1","viewport":{"width":393,"height":660},"screen":{"width":393,"height":852},"deviceScaleFactor":3,"isMobile":true,"hasTouch":true,"defaultBrowserType":"webkit"}}
    mobile: I am on page "https://www.google.com"
    › [Browser:Info] Autofocus processing was blocked because a document already has a focused element.
    › [Browser:Error] Permissions policy violation: unload is not allowed in this document.
    mobile: I wait 5
  ✔ OK in 11410ms


  OK  | 1 passed   // 13s

Provide test source code if related

import { devices } from "playwright";

Feature("login");

Scenario("test something", ({ I }) => {
  I.amOnPage("https://www.google.com");
  I.wait(5);
  session(
    "mobile",
    {
      browser: "webkit",
      emulate: devices["iPhone 14 Pro"],
    },
    () => {
      I.amOnPage("https://www.google.com");
      I.wait(5);
    }
  );
});

Details

CodeceptJS version: 3.6.3
NodeJS Version: 20.14.5
Operating System: MacOS 14.4 (23E214)
playwright 1.44.1

  • Configuration file:
import { setHeadlessWhen, setCommonPlugins } from "@codeceptjs/configure";
import { devices } from "playwright";

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();

export const config: CodeceptJS.MainConfig = {
  tests: "./*_test.ts",
  output: "./output",
  helpers: {
    Playwright: {
      browser: "chromium",
      emulate: devices["Chrome Desktop"],
      url: "http://localhost",
      show: true,
    },
  },
  include: {
    I: "./steps_file",
  },
  name: "crossdevices",
};

multisession_issue

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

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.