cancel
Showing results for 
Search instead for 
Did you mean: 

OPA Page Can't Find View

ianfmccallum
Explorer
0 Kudos

I'm new to OPA testing, and have been able to get the 'plumbing' to work, but when I add the 'viewName' tag to the actions or assertions structure in the CreatePageObjects function of my page file (please see below), the OPA test claims it can't find the view. When I remove the 'viewName' tag, the function below works.

  1. Are the view names fully qualified?
  2. Do I need to set a resourceroot in the opaTest.qunit.html file?

Thank you in advance for your help!

Opa5.createPageObjects({
	duringRegionApplicationTest: {


		actions: {
			iPressTheAddButton: function () {
				return this.waitFor({
                                        viewName: "Region",
					controlType: "sap.m.Button",
					success: function (aButtons) {
						aButtons[0].$().trigger("tap");
					},
					errorMessage: "Did not find the Add button on the app page"
				});
			}
		},
		assertions: {
			iShouldSeeTheAddDialog: function () {
				return this.waitFor({
					controlType: "sap.m.Dialog",
					success: function () {
						Opa5.assert.ok(true, "The dialog is open");
					},
					errorMessage: "Did not find the dialog control"
				});
			}
		}
	}
});

Accepted Solutions (1)

Accepted Solutions (1)

ianfmccallum
Explorer
0 Kudos

Turns out the OPA testing module needs to have the right path to the view (of course)!

Once the view path is established correctly (using a combination of the resourceroot in the opaTest.qunit.html relative to the opaTest.qunit.html location, and by creating a configuration item called the 'viewNamespace' -- see below) the tests run correctly.

Opa5.extendConfig({
   viewNamespace: "app.cco.region.view."
});

Answers (0)