swithTo/within not swith to iframe
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
- 领域
- testing-qa
调研方向
首先在 CodeceptJS 3.6 中复现所提供的 Puppeteer 流程,重点关注使用所提供 iframe 选择器的 switchTo、within 和 waitForElement。将行为与 CodeceptJS 3.4.1 进行比较,并在定位出失败原因后添加回归覆盖;完成的标准是 iframe 输入选择器能够解析,并且所提供的序列能够完成。
由索引模型根据 Issue 内容生成。
描述
What are you trying to achieve?
After update codeceptjs, I can't get input in iframe. I just try using switchTo and within. My code work on codecept 3.4.1
What do you get instead?
Provide console output if related. Use
--verbosemode for more details.
I wait for visible "[data-marker=new-card]", 5
I click "[data-marker=new-card]"
I wait for element "[data-marker=iframe]", 5
I switch to "[data-marker=iframe]"
I wait for element "[id=pan]", 5
› [Browser:Warning]
[1] Error (Non-Terminated) | Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded | (err) => { step.status = 'failed'; step.endTime = ...
[1] Error | Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded undefined...
[1] <teardown> Stopping recording promises
...
Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded
Provide test source code if related
await I.waitForElement(this.iframe, FRONT_TIMEOUT_SEC);
await I.switchTo(this.iframe);
await I.waitForElement(this.cardNumberInput, FRONT_TIMEOUT_SEC);
await I.waitForVisible(this.cardNumberInput, FRONT_TIMEOUT_SEC);
await I.fillField(this.cardNumberInput, creditCard.cardNumber);
await I.fillField(this.expDateInput, creditCard.expDate);
await I.fillField(this.cvcInput, creditCard.cvv);
await I.switchTo();
Details
- CodeceptJS version: 3.6
- NodeJS Version: 18.16.1
- Operating System: mac os
- puppeteer || webdriverio || testcafe version (if related)
- Configuration file:
exports.config = {
fullPromiseBased: true,
tests: testsPath,
output: `${pwd}/output`,
bootstrap: () => {
global.codecept_dir = pwd;
},
name: 'xxx',
helpers: {
Puppeteer: {
show: true,
waitForNavigation: 'networkidle2',
waitForTimeout: 30000,
getPageTimeout: 30000,
windowSize: '1000x1000',
browser: 'chrome',
chrome: {
args: ['--no-sandbox',
'--window-size=1920,1000',
'--disable-setuid-sandbox',
'--disable-web-security',
// workaround for iframe in {headless: false} mode,
// see details https://github.com/puppeteer/puppeteer/issues/4964
'--disable-features=site-per-process',
],
devtools: false,
},
manualStart: false,
restart: false,
keepCookies: true,
keepBrowserState: false,
},
FileSystem: {},
},
plugins: {
screenshotOnFail: {
enabled: false,
},
retryTo: {
enabled: true
},
tryTo: {
enabled: true,
require: ''
}
},
require: ['ts-node/register'],
};
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 756
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeceptjs/CodeceptJS 的其他 Issue
-
stale
难度 2/5 1-3 小时 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 76/100
codeceptjs/CodeceptJS#5358 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 条评论 · 2 个 reaction ·
-
stale
难度 1/5 1 小时以内 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 条评论 ·
-
stale
难度 4/5 3-5 天 新手友好度 38/100
codeceptjs/CodeceptJS#5618 · 1 条评论 ·
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
难度 1/5 1 小时以内 新手友好度 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·