Skip to content

Commit

Permalink
solved #30; coined ver 1.22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kazurayam committed Jul 27, 2020
1 parent 96500fe commit fe25ffe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions Scripts/CURA/Login/Script1554796318752.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ WebUI.setText(findTestObject('CURA/Page_Login/input_password'), Password)
//Path png2 = mr.resolveMaterialPath(GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()], "CURA_Login.png")
Path png2 = mr.resolveScreenshotPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
new URL(WebUI.getUrl()),
0,
'top.png')
Expand Down
17 changes: 15 additions & 2 deletions Scripts/CURA/visitSite/Script1554796633484.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.temporal.TemporalAccessor

import com.kazurayam.materials.FileType
import com.kazurayam.materials.MaterialRepository
import com.kazurayam.visualtesting.ManagedGlobalVariable as MGV
import com.kms.katalon.core.configuration.RunConfiguration
Expand Down Expand Up @@ -42,6 +43,7 @@ WebUI.delay(1)

Path png1 = mr.resolveScreenshotPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
url,
0,
'home')
Expand All @@ -51,14 +53,22 @@ WebUI.comment("saved image into ${png1}")
// create one more screenshot file with name in Japanese
Path png2 = mr.resolveMaterialPath(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
"トップ.png")
CustomKeywords.'com.kazurayam.ksbackyard.ScreenshotDriver.takeEntirePage'(driver, png2.toFile(), 500)
WebUI.comment("saved image into ${png1}")

// if required, save page source as HTML
if (GlobalVariable.SAVE_PAGE_SOURCE != null && GlobalVariable.SAVE_PAGE_SOURCE == true) {
Path html = png1.getParent().resolve(png1.getFileName().toString().replace('.png', '.html'))
String content = driver.getPageSource()
//Path html = png1.getParent().resolve(png1.getFileName().toString().replace('.png', '.html'))
Path html = mr.resolveMaterialPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'pagesources',
url,
0,
'home',
FileType.HTML)
String content = driver.getPageSource()
html.toFile().write(content, 'utf-8')
}

Expand Down Expand Up @@ -95,6 +105,7 @@ WebUI.setText(findTestObject('CURA/Page_Appointment/textarea_comment'), 'This is
//Path png3 = mr.resolveMaterialPath(GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()], "CURA_Appointment.png")
Path png3 = mr.resolveScreenshotPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
new URL(WebUI.getUrl()),
0)
CustomKeywords.'com.kazurayam.ksbackyard.ScreenshotDriver.takeEntirePage'(driver, png3.toFile(), 500)
Expand Down Expand Up @@ -144,6 +155,7 @@ if (comment != null) {
//Path png4 = mr.resolveMaterialPath(GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()], "CURA_AppointmentConfirmation.png")
Path png4 = mr.resolveScreenshotPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
new URL(WebUI.getUrl()),
0)
CustomKeywords.'com.kazurayam.ksbackyard.ScreenshotDriver.takeEntirePage'(driver, png4.toFile(), 500)
Expand All @@ -161,6 +173,7 @@ WebUI.verifyElementPresent(findTestObject('CURA/Page_Homepage/a_Make Appointment
//Path png5 = mr.resolveMaterialPath(GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()], "CURA_Homepage_revisited.png")
Path png5 = mr.resolveScreenshotPathByURLPathComponents(
GlobalVariable[MGV.CURRENT_TESTCASE_ID.getName()],
'screenshots',
new URL(WebUI.getUrl()),
0,
'revisited')
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

apply plugin: 'groovy'

version = "1.22.1"
version = "1.22.2"

ext {
groovyVersion = '2.4.7'
Expand All @@ -12,7 +12,7 @@ ext {
VT_DIST_COMPONENTS_PREFIX = 'vt-components'
VT_DIST_EXAMPLE_PREFIX = 'vt-example'

materialsVersion = '0.79.0'
materialsVersion = '0.79.1'
}

// ---------------------------------------------------------------------
Expand Down

0 comments on commit fe25ffe

Please sign in to comment.