[MGNLTEST-88] pageobjects.Form#clickButton does not work on some forms Created: 21/Aug/20  Updated: 16/Dec/20  Resolved: 16/Dec/20

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.4

Type: Bug Priority: Neutral
Reporter: Michael Duerig Assignee: Rishab Dhar
Resolution: Fixed Votes: 0
Labels: QA&Testing, ui-test-fwk
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-10-14-12-59-57-728.png     PNG File image-2020-10-14-13-00-57-871.png    
Issue Links:
Cloners
is cloned by MGNLTEST-131 Align Form PO button lookup by icon v... Selected
Relates
relates to MGNLTEST-115 Make test-framework case-insensitive Selected
dependency
is depended upon by ABTEST-330 UI test for actions in variant tab on... Closed
is depended upon by ABTEST-331 Check and enable ui tests Closed
relation
is related to MGNLTEST-66 Page objects - Provide access to defa... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: core-TF-features-bugs-improvements
Sprint: TE 14
Story Points: 3

 Description   

Form#clickButton(java.lang.String) does not work on e.g. the "Verify setup" tab of the "Mail tools" app:

 

@Test
void detectMailForm(PageObjects expect){
    // GIVEN
    expect.findBar().openApp("Mail tools");

    // THEN
    expect.form(Form.detectTab("Mail"))
        .openTab("Verify setup")
        .clickButton("Send test mail");
} 

Throws an exception:

org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"..//span[text() = 'Send test mail']/parent::*/parent::*[@role='button']"}
  (Session info: chrome=84.0.4147.105)
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Michaels-MBP.fritz.box', ip: 'fe80:0:0:0:4d6:7d82:1ef3:750f%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '12.0.2'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 84.0.4147.105, chrome: {chromedriverVersion: 84.0.4147.30 (48b3e868b4cc0..., userDataDir: /tmp/.com.google.Chrome.YqXQVv}, goog:chromeOptions: {debuggerAddress: localhost:44843}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true, webdriver.remote.sessionid: c903de6e75b31bbcc62229b68c9...}
Session ID: c903de6e75b31bbcc62229b68c97beae
*** Element info: {Using=xpath, value=..//span[text() = 'Send test mail']/parent::*/parent::*[@role='button']}	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
	at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:185)
	at org.openqa.selenium.remote.RemoteWebElement.findElementByXPath(RemoteWebElement.java:261)
	at org.openqa.selenium.By$ByXPath.findElement(By.java:353)
	at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:181)
	at info.magnolia.test.selenium.pageobjects.Button.findByLabel(Button.java:61)
	at info.magnolia.test.selenium.pageobjects.Form.clickButton(Form.java:181)
 


 Comments   
Comment by Christoph Meier [ 14/Oct/20 ]

See https://git.magnolia-cms.com/projects/ADDON/repos/addon-tests/pull-requests/29/diff#magnolia-addon-tests/tests/src/test/java/info/magnolia/addon/uitest/ABTestingUITest.java for the failure encountered by Nguyen

Comment by Mikaël Geljić [ 14/Oct/20 ]

looking at the sources now, looks a bit inconsistent: #clickButton(String) looks it up in footer actions, whereas #clickButton(Icon) looks it up within the form. I'm still surprised if we indeed don't support the link-field use case yet
[...]
#clickButton(String) should look up for buttons both in form/dialog footer and in the form itself like the icon-method does.
—will likely require using #failFastFindElement since we don't want any of the two selectors to time-out.

Comment by Aleksandr Pchelintcev [ 27/Oct/20 ]

To be reviewed by mgeljic

Generated at Mon Feb 12 07:45:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.