Playwright 与 browserstack sdk 集成抛出 - TypeError: 无法读取未定义的属性(读取 'wsEndpoint')

问题描述 投票:0回答:1

这是我的 browserstack.yml 文件

userName: ******
accessKey: *****
framework: playwright
platforms:
  - os: OS X
    osVersion: Ventura
    browserName: Chrome
    browserVersion: latest
browserstackLocal: false
buildName: playwright-js
buildIdentifier: ${BUILD_NUMBER}
projectName: playwright-js
debug: true
consoleLogs: verbose

这是 playwright.config.ts

import { defineConfig, devices } from '@playwright/test';
import path from 'path';

export default defineConfig({
  testDir: path.join(__dirname, "specs/smoke/plawright/tests"),
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  use: {
    trace: 'on-first-retry',
  },
npx browserstack-node-sdk playwright test is the command that i am using and i get the 
Running 1 test using 1 worker
  1) [chrome@latest:OSX Ventura@browserstack] › example.spec.ts:18:7 › search from ** › ** ** 

    TypeError: Cannot read properties of undefined (reading 'wsEndpoint')

我能够通过遗留集成弄清楚这一点

const cdpUrl = `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify(capabilities))} i

是必需的。使用旧版的问题是,它不允许多种配置,而且配置也不够稳定来运行测试。

我尝试了legacy和sdk。`

playwright browserstack
1个回答
0
投票

请尝试在项目的 browserstack.yml 配置文件中添加 logLeve: debug,然后检查“log”文件夹中生成的 SDK 日志文件是否有任何错误/异常。

© www.soinside.com 2019 - 2024. All rights reserved.