-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committing what I have before starting again
- Loading branch information
Showing
14 changed files
with
418 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
serenity-model/src/main/java/net/thucydides/model/requirements/SerenityJsRequirements.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package net.thucydides.model.requirements; | ||
|
||
import net.serenitybdd.model.di.ModelInfrastructure; | ||
import net.serenitybdd.model.environment.ConfiguredEnvironment; | ||
import net.thucydides.model.domain.ReportType; | ||
import net.thucydides.model.domain.RequirementCache; | ||
import net.thucydides.model.issues.IssueTracking; | ||
import net.thucydides.model.reports.TestOutcomeLoader; | ||
import net.thucydides.model.reports.html.ReportNameProvider; | ||
import net.thucydides.model.requirements.reports.RequirementsOutcomeFactory; | ||
import net.thucydides.model.requirements.reports.SerenityJsRequirementsOutcomeFactory; | ||
import net.thucydides.model.util.EnvironmentVariables; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import static net.thucydides.model.reports.html.ReportNameProvider.NO_CONTEXT; | ||
|
||
public class SerenityJsRequirements implements Requirements { | ||
|
||
private final RequirementsService requirementsService; | ||
private final RequirementsOutcomeFactory requirementsOutcomeFactory; | ||
|
||
public static SerenityJsRequirements from(Path testScenariosDirectory, Path jsonOutcomesDirectory) { | ||
EnvironmentVariables environmentVariables = ModelInfrastructure.getEnvironmentVariables(); | ||
IssueTracking issueTracking = ModelInfrastructure.getIssueTracking(); | ||
RequirementCache requirementCache = RequirementCache.getInstance(); | ||
TestOutcomeLoader testOutcomeLoader = new TestOutcomeLoader(environmentVariables); | ||
Path outputDirectory = ConfiguredEnvironment.getConfiguration().getOutputDirectory().toPath(); | ||
|
||
SerenityJsTagProvider serenityJsTagProvider = new SerenityJsTagProvider( | ||
requirementCache, | ||
testOutcomeLoader, | ||
environmentVariables, | ||
testScenariosDirectory, | ||
jsonOutcomesDirectory, | ||
outputDirectory | ||
); | ||
|
||
RequirementsTagProvider testOutcomeTagProvider = new TestOutcomeRequirementsTagProvider(environmentVariables) | ||
.fromSourceDirectory(jsonOutcomesDirectory); | ||
|
||
return new SerenityJsRequirements( | ||
environmentVariables, | ||
issueTracking, | ||
// serenityJsTagProvider | ||
testOutcomeTagProvider | ||
); | ||
} | ||
|
||
public SerenityJsRequirements( | ||
EnvironmentVariables environmentVariables, | ||
IssueTracking issueTracking, | ||
RequirementsTagProvider tagProvider | ||
) { | ||
this.requirementsService = new AggregateRequirementsService(environmentVariables, tagProvider); | ||
this.requirementsOutcomeFactory = new SerenityJsRequirementsOutcomeFactory( | ||
environmentVariables, | ||
issueTracking, | ||
new ReportNameProvider(NO_CONTEXT, ReportType.HTML, requirementsService), | ||
tagProvider | ||
); | ||
} | ||
|
||
@Override | ||
public RequirementsService getRequirementsService() { | ||
return requirementsService; | ||
} | ||
|
||
@Override | ||
public RequirementsOutcomeFactory getRequirementsOutcomeFactory() { | ||
return requirementsOutcomeFactory; | ||
} | ||
|
||
@Override | ||
public List<String> getTypes() { | ||
return requirementsService.getRequirementTypes(); | ||
} | ||
} |
Oops, something went wrong.