-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1050: Add more integration tests
- Loading branch information
Frank Duncan
committed
Aug 28, 2018
1 parent
a40eac9
commit ecf670a
Showing
8 changed files
with
331 additions
and
25 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
35 changes: 35 additions & 0 deletions
35
...gration-tests/src/test/java/gov/medicaid/features/enrollment/ui/CcmhrCredentialsPage.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,35 @@ | ||
package gov.medicaid.features.enrollment.ui; | ||
|
||
import gov.medicaid.features.PsmPage; | ||
|
||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
import java.time.LocalDate; | ||
|
||
public class CcmhrCredentialsPage extends PsmPage { | ||
public void addCTSSCertification(LocalDate beginDate, LocalDate endDate) throws IOException { | ||
$("[name=_34_certificateInd_1]").click(); | ||
$("[name=_34_beginDate_1]").type(format(beginDate)); | ||
$("[name=_34_endDate_1]").type(format(endDate)); | ||
uploadSampleFile("Certification", "_34_attachment_1"); | ||
} | ||
|
||
public void addCrisisStabilizationContract(LocalDate beginDate, LocalDate endDate) throws IOException { | ||
$("[name=_34_certificateInd_3]").click(); | ||
$("[name=_34_beginDate_3]").type(format(beginDate)); | ||
$("[name=_34_endDate_3]").type(format(endDate)); | ||
uploadSampleFile("Certification", "_34_attachment_3"); | ||
} | ||
|
||
private void uploadSampleFile(String typeName, String formName) throws IOException { | ||
File temporaryFile = File.createTempFile(typeName + ".", ".txt"); | ||
try (PrintWriter writer = new PrintWriter( | ||
new FileOutputStream(temporaryFile))) { | ||
writer.println(typeName); | ||
} | ||
upload(temporaryFile.getAbsolutePath()).to($("[name=" + formName + "]")); | ||
temporaryFile.deleteOnExit(); | ||
} | ||
} |
Oops, something went wrong.