Element is not found in Firefox even though it is definitely there
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- testing-qa
调研方向
首先,使用 CodeceptJS 3.7.5、Webdriver 9.19.2 和 Firefox 重现所提供的 page-object 登录流程,并将点击账户图标进行导航与 I.amOnPage() 进行比较。针对 Chrome 和列出的 Firefox 版本,检查报告的 loginFormSelector (#LoginForm) 查找问题。完成标准是确定 Firefox 特有的失败原因,并确认可靠的修复或 workaround。
由索引模型根据 Issue 内容生成。
描述
I've been facing the following problem for about a week without any updates to CodeceptJS (or other dependencies) or the application code.
- test clicks on the account icon in the page header
- login form opens
- CodeceptJS should verify that a certain element exists
- it doesn't find it within 10 seconds even though it's definitely there; in open mode I can see it and inspect the DOM and it's there
- this happens 95% of time, very rarely it works
- it worked fine until about a week ago
This is the login method in the page object. The selector it doesn't find is the loginFormSelector.
login(email, password) {
this.openLoginForm()
this.fillLoginForm(email, password)
}
openLoginForm() {
I.waitForClickable(this.navigationLinks.responsiveLogin, 10)
I.click(this.navigationLinks.responsiveLogin)
I.waitForElement(this.loginFormSelector, 10) // selector is '#LoginForm'
}
fillLoginForm(email, password) {
I.fillField(this.customerData.loginCustomerEmail, email)
I.click(this.buttons.loginSubmit)
}
The HTML looks like this:
<div id="AccountLogin">
<section>
<section>...</section>
<section id="LoginForm">
<header>...</header>
<form>...</form>
</section>
</section>
</div>
What found out so far:
- no iframe
- no shadow DOM
- if I print the DOM with grabHTML in headless mode, the element is there
- if I inspect the DOM in headed mode, the element is there
- if I pause the test after it enters the login page, I can use I.seeElement in the terminal and it find the element, yet the test fails upon continuation
Does not help:
- waitForVisible instead of waitForElement
- upping the timeout to 20
- adding a hard 3 second wait
- using an older version of Firefox (I tried 145, 144 and 142)
- running it locally or in the CI pipeline does not make a difference
- using a different selector
Does help:
- going to the login page by navigating to it with I.amOnPage() instead of clicking a link to get there
- using Chrome instead of Firefox
CodeceptJS: 3.7.5
Webdriver: 9.19.2
Browser: Firefox 145 (and 144 and 142)
- 主要语言
- 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 ·
-
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 ·
-
ecosystem wording
难度 1/5 1 小时以内 新手友好度 90/100
matrix-org/matrix.org#3649 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
vadimdemedes/ink#1029 ·