wttech / bobcat

Bobcat is an automated testing framework for functional testing of web applications.
https://cognifide.github.io/bobcat/
Apache License 2.0
90 stars 40 forks source link

AEM BDD Test case fails while doing component configuration #415

Open gkravi opened 4 years ago

gkravi commented 4 years ago

Environment

Bobcat version: 2.1.0

Bobcat modules used:

Browser + version: Chrome 79.0.3945.130

Git code repo: link

Expected Behavior

The test case needs to update the text and title component from the yaml file.

Actual Behavior

Test case not able to update the component configuration. And getting exception: `When i am running the feature file below snippet for title and text component:

@And("^I configure the Title component Title field to be Test Page Title") public void I_configure_the_title_component() throws ActionException { controller.execute(AemActions.CONFIGURE_COMPONENT, new ConfigureComponentData("container", "Title", 0, new ResourceFileLocation("title.yaml"))); } `

Exception: `I am getting error while bobcat tries to edit the component step, the error log below:

For title test case:

When I open the test title page # TitleFeatureSteps.I_open_the_test_page(String)

And I configure the Title component Title field to be Test Page Title # TitleFeatureSteps.I_configure_the_title_component()
  java.lang.IllegalStateException: YAML file could not be read
at com.cognifide.qa.bb.utils.YamlReader.readFromTestResources(YamlReader.java:93)
at com.cognifide.qa.bb.aem.core.component.configuration.ComponentConfigResourceFileReader.readConfiguration(ComponentConfigResourceFileReader.java:45)
at com.cognifide.qa.bb.aem.core.component.configuration.ComponentConfigResourceFileReader.readConfiguration(ComponentConfigResourceFileReader.java:34)
at com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponent.execute(ConfigureComponent.java:64)
at com.cognifide.qa.bb.frame.FrameAspect.switchFrameAndProceed(FrameAspect.java:70)
at com.cognifide.qa.bb.frame.FrameAspect.invoke(FrameAspect.java:58)
at com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponent.execute(ConfigureComponent.java:40)
at com.cognifide.qa.bb.api.actions.internal.DefaultController.execute(DefaultController.java:55)
at com.honeywell.honeywell.steps.TitleFeatureSteps.I_configure_the_title_component(TitleFeatureSteps.java:75)
at ?.I configure the Title component Title field to be Test Page Title(file:src/test/resources/features/title.feature:8)

Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input at [Source: UNKNOWN; line: 1, column: 1]`

`For text component:

java.lang.NullPointerException at com.cognifide.qa.bb.aem.core.component.dialog.DialogFieldRetrieverImpl.getFields(DialogFieldRetrieverImpl.java:95) at com.cognifide.qa.bb.aem.core.component.dialog.DialogFieldRetrieverImpl.getDialogField(DialogFieldRetrieverImpl.java:68) at com.cognifide.qa.bb.aem.core.component.dialog.ConfigDialogImpl.lambda$setFields$4(ConfigDialogImpl.java:208) at java.util.ArrayList.forEach(ArrayList.java:1257) at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) at com.cognifide.qa.bb.aem.core.component.dialog.ConfigDialogImpl.setFields(ConfigDialogImpl.java:207) at com.cognifide.qa.bb.aem.core.component.dialog.ConfigDialogImpl.lambda$configure$3(ConfigDialogImpl.java:201) at java.util.ArrayList.forEach(ArrayList.java:1257) at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) at com.cognifide.qa.bb.aem.core.component.dialog.ConfigDialogImpl.configure(ConfigDialogImpl.java:199) at com.cognifide.qa.bb.aem.core.component.dialog.ConfigDialogImpl.configureWith(ConfigDialogImpl.java:133) at com.cognifide.qa.bb.frame.FrameAspect.switchFrameAndProceed(FrameAspect.java:70) at com.cognifide.qa.bb.frame.FrameAspect.invoke(FrameAspect.java:58) at com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponent.execute(ConfigureComponent.java:65) at com.cognifide.qa.bb.frame.FrameAspect.switchFrameAndProceed(FrameAspect.java:70) at com.cognifide.qa.bb.frame.FrameAspect.invoke(FrameAspect.java:58) at com.cognifide.qa.bb.aem.core.component.actions.ConfigureComponent.execute(ConfigureComponent.java:40) at com.cognifide.qa.bb.api.actions.internal.DefaultController.execute(DefaultController.java:55) at com.honeywell.honeywell.steps.TextFeatureSteps.I_configure_the_title_component(TextFeatureSteps.java:74) at ?.I configure the Text component text field to be Test Page Text(file:src/test/resources/features/text.feature:8)`

Please help me as i am stuck in this for quite some time.

Thanks! Ravi

Steps to reproduce

Git repo for code to reproduce the issue: Git link