Page MenuHomePhabricator

TemplateWizard Selenium tests fail in CI with "element (".oo-ui-lookupElement-menu") still not displayed after 5000ms"
Closed, ResolvedPublic

Description

While working on T294110, I've noticed that TemplateWizard Selenium tests fail in CI. Terminal output isn't helpful. (Commit 732977, job: 83468.)

> selenium-test
> wdio tests/selenium/wdio.conf.js

Execution of 1 spec files started at 2021-10-22T13:58:00.762Z

[0-0] RUNNING in chrome - /tests/selenium/specs/TemplateWizard.js
...
[0-0] FAILED in chrome - /tests/selenium/specs/TemplateWizard.js

Spec Files:	 0 passed, 1 failed, 1 total (100% completed) in 00:00:14

WDIO.xunit-2021-10-22T13-58-01-851Z.xml file in build artifacts has more information.

<testcase classname="chrome.90_0_4430_212.linux.TemplateWizard" name="before each hook for TemplateWizard" time="9.441">
  <error message="element (&quot;.oo-ui-lookupElement-menu&quot;) still not displayed after 5000ms"/>
  <system-err><![CDATA[
	Error: element (".oo-ui-lookupElement-menu") still not displayed after 5000ms
	    at Context.<anonymous> (/workspace/src/extensions/TemplateWizard/tests/selenium/specs/TemplateWizard.js:29:36)
	]]></system-err>
</testcase>

The entire file:

1<?xml version="1.0" encoding="UTF-8"?>
2<testsuites>
3 <testsuite name="TemplateWizard" timestamp="2021-10-22T13:58:05" time="9.444" tests="2" failures="1" errors="1" skipped="1">
4 <properties>
5 <property name="specId" value="0"/>
6 <property name="suiteName" value="TemplateWizard"/>
7 <property name="capabilities" value="chrome.90_0_4430_212.linux"/>
8 <property name="file" value="./tests/selenium/specs/TemplateWizard.js"/>
9 </properties>
10 <testcase classname="chrome.90_0_4430_212.linux.TemplateWizard" name="has 1 required field visible" time="0">
11 <skipped/>
12 <system-out><![CDATA[
13COMMAND: navigateTo - {"url":"http://127.0.0.1:9412//index.php?title=Template%3AExample%200.9804444250229798-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n"}
14RESULT: undefined
15COMMAND: findElement - {"using":"css selector","value":".mw-templatedata-doc-wrap"}
16RESULT: undefined
17COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-1","ELEMENT":"ELEMENT-1"}]}
18RESULT: undefined
19COMMAND: navigateTo - {"url":"http://127.0.0.1:9412//index.php?action=edit&title=TemplateWizard_test"}
20RESULT: undefined
21COMMAND: findElement - {"using":"css selector","value":"[rel=\"template-wizard\"] a[role=\"button\"]"}
22RESULT: undefined
23COMMAND: findElement - {"using":"css selector","value":"[rel=\"template-wizard\"] a[role=\"button\"]"}
24RESULT: undefined
25COMMAND: findElement - {"using":"css selector","value":"[rel=\"template-wizard\"] a[role=\"button\"]"}
26RESULT: undefined
27COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-2","ELEMENT":"ELEMENT-2"}]}
28RESULT: undefined
29COMMAND: findElement - {"using":"css selector","value":"[rel=\"template-wizard\"] a[role=\"button\"]"}
30RESULT: undefined
31COMMAND: elementClick - {"elementId":"ELEMENT-3"}
32RESULT: undefined
33COMMAND: findElement - {"using":"css selector","value":"#ext-templatewizard-dialog"}
34RESULT: undefined
35COMMAND: findElement - {"using":"css selector","value":"#ext-templatewizard-dialog"}
36RESULT: undefined
37COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-4","ELEMENT":"ELEMENT-4"}]}
38RESULT: undefined
39COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-4","ELEMENT":"ELEMENT-4"}]}
40RESULT: undefined
41COMMAND: findElement - {"using":"css selector","value":".oo-ui-comboBoxInputWidget-field"}
42RESULT: undefined
43COMMAND: elementClick - {"elementId":"ELEMENT-5"}
44RESULT: undefined
45COMMAND: findElement - {"using":"css selector","value":".ext-templatewizard-searchform input"}
46RESULT: undefined
47COMMAND: elementClear - {"elementId":"ELEMENT-6"}
48RESULT: undefined
49COMMAND: elementSendKeys - {"elementId":"ELEMENT-6","text":"Example 0.9804444250229798-Iñtërnâtiônàlizætiøn"}
50RESULT: undefined
51COMMAND: findElement - {"using":"css selector","value":".oo-ui-lookupElement-menu"}
52RESULT: undefined
53COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
54RESULT: undefined
55COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
56RESULT: undefined
57COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
58RESULT: undefined
59COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
60RESULT: undefined
61COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
62RESULT: undefined
63COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
64RESULT: undefined
65COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
66RESULT: undefined
67COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
68RESULT: undefined
69COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
70RESULT: undefined
71COMMAND: executeScript - {"script":"return (function isElementDisplayed(element) {\n function nodeIsElement(node) {\n if (!node) {\n return false;\n }\n switch (node.nodeType) {\n case Node.ELEMEN ... (7762 more bytes)","args":[{"element-6066-11e4-a52e-4f735466cecf":"ELEMENT-7","ELEMENT":"ELEMENT-7"}]}
72RESULT: undefined
73COMMAND: deleteSession - {}
74RESULT: undefined
75]]></system-out>
76 </testcase>
77 <testcase classname="chrome.90_0_4430_212.linux.TemplateWizard" name="before each hook for TemplateWizard" time="9.441">
78 <failure/>
79 <error message="element (&quot;.oo-ui-lookupElement-menu&quot;) still not displayed after 5000ms"/>
80 <system-err><![CDATA[
81Error: element (".oo-ui-lookupElement-menu") still not displayed after 5000ms
82 at Context.<anonymous> (/workspace/src/extensions/TemplateWizard/tests/selenium/specs/TemplateWizard.js:29:36)
83]]></system-err>
84 </testcase>
85 </testsuite>
86</testsuites>

I don't think 732977 introduced the problem, because I've ran tests for another recent (merged) patch, and they fail there too, with the same error message. (Patch: 728638, job: 83489.)

Event Timeline

zeljkofilipin renamed this task from TemplateWizard Selenium tests fail in CI with '' to TemplateWizard Selenium tests fail in CI with "element (".oo-ui-lookupElement-menu") still not displayed after 5000ms".Oct 22 2021, 3:00 PM
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)

Change 732977 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/extensions/TemplateWizard@master] selenium: Cleanup of @wdio packages

https://gerrit.wikimedia.org/r/732977

Change 736725 had a related patch set uploaded (by Zfilipin; author: AghaSaad04):

[mediawiki/extensions/TemplateWizard@master] Issue: WebDriver was not waiting for the object and test cases were getting failed

https://gerrit.wikimedia.org/r/736725

Change 736725 merged by jenkins-bot:

[mediawiki/extensions/TemplateWizard@master] selenium: Fix failing test

https://gerrit.wikimedia.org/r/736725

Change 732977 merged by jenkins-bot:

[mediawiki/extensions/TemplateWizard@master] selenium: Cleanup of @wdio packages

https://gerrit.wikimedia.org/r/732977