cancel
Showing results for 
Search instead for 
Did you mean: 

OPA5 cannot locate controls inside ComponentContainer

02-11-2020 2:47 AM
MioYasutake SAP Champion
613 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Hi experts,

I'm trying to test an app with OPA5.

App view loads component from custom library, and the component simply displays a button (sap.m.Button).

Below is controller's code loading the component.

			this.getOwnerComponent().createComponent({
				usage: "myButton",
				settings: {},
				componentData: {},
				async: true
			}).then(function(oComp) {
				this.byId("box").addItem(new ComponentContainer({
					id: "myButtonComp",
					component: oComp
				}));                         
			}.bind(this)).catch(function(oError) {
				MessageBox.error(oError.message);
			});

The problem is, OPA5 doesn't recognize created component nor the button inside it.

				iShouldSeeMyButton: function () {
					return this.waitFor({
						viewName: sViewName,
						id: "myButtonComp",
						success: function () {
							Opa5.assert.ok(true, "The button is displayed");
						},
						errorMessage: "Did not find the button"
					});					
				}
Above code didn't work even if I changed 'id: "myButtonComp" to 'controlType: "sap.m.Button"'.With UI5 inspector tool, I could see both the ComponentContainer and button exited.

Actually, my intention was to test library components (Component.js and fragments) with OPA5. If you know how to achieve this, please help.Regards,Mio
0 Likes

Accepted Solutions (0)

Answers (0)