Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties from the summary.properties files are read only at the start of the execution #307

Closed
ivgenis opened this issue Sep 27, 2017 · 1 comment

Comments

@ivgenis
Copy link

ivgenis commented Sep 27, 2017

Hi,

Properties don’t appear correctly in the reporter.

Looks like summary.properties file is being read in the wrong place.

When running scenario at the first time and adding properties A,B,C to summary.properties, I don't see them in the reporter at the end of the run, this is what I see:

dif

After running scenario again on the same JSystem instance (summary.properties with “A,B,C” already exists at the beginning of the run), I will see “A,B,C” in the reporter, but won’t see the properties that were added to summary.properties during the current run.

@itaiag
Copy link
Contributor

itaiag commented Dec 4, 2017

The summary properties are read only at the creation of the root element. We should change it to be read at the beginning or end of each test case (building block).
The change needs to be done in the AbstractHtmlReporter in the startContainer method:

	@Override
	public void startContainer(JTestContainer container) {
		log.fine("Recieved start containter event");
		if (firstTest) {
			firstTest = false;
			startRun();
		}
		ScenarioNode scenario = new ScenarioNode(ScenarioHelpers.removeScenarioHeader(container.getName()));
		if (container.isRoot()) {
			// We keep scenario history only for the root scenario;
			int numOfAppearances = getAndUpdateTestHistory(container.getName());
			if (numOfAppearances > 0) {
				scenario.setName(scenario.getName() + " (" + ++numOfAppearances + ")");
			}
			addScenarioProperties(scenario);
			execution.getLastMachine().addChild(scenario);
		} else {
			if (container instanceof AntForLoop) {
				scenario.setName(((AntForLoop) container).getTestName(0));
			} else if (container instanceof AntFlowControl) {
				scenario.setName(container.getTestName());
			}
			currentScenario.addChild(scenario);
		}
		currentScenario = scenario;
		writeExecution(execution);

	}

The addScenarioProperties call should not happen only if the scenario is root

@itaiag itaiag self-assigned this Dec 4, 2017
@itaiag itaiag modified the milestones: 6.1.08, 6.1.09 Dec 4, 2017
@itaiag itaiag changed the title Properties from summary.properties don't appear in difido reporter Properties from the summary.properties files are read only at the start of the execution Dec 4, 2017
@itaiag itaiag closed this as completed Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants