[gui-test] added debug screenshots before and after test

This commit is contained in:
Viktoria.Shirunova
2019-01-25 13:49:15 +03:00
parent 3074b01e1d
commit a3a08e6dee
3 changed files with 30 additions and 0 deletions
@@ -3,7 +3,11 @@ package com.intellij.ide.projectWizard.kotlin.createProject
import com.intellij.ide.projectWizard.kotlin.model.*
import com.intellij.testGuiFramework.framework.param.GuiTestSuiteParam
import com.intellij.testGuiFramework.impl.ScreenshotOnFailure
import com.intellij.testGuiFramework.util.currentTimeInHumanString
import com.intellij.testGuiFramework.util.scenarios.NewProjectDialogModel
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@@ -20,6 +24,16 @@ class CreateGradleKotlinDslProjectWithKotlinGuiTest(private val testParameters:
override fun toString() = projectName
}
@Before
fun beforeTest(){
ScreenshotOnFailure.takeScreenshot("${currentTimeInHumanString}_before_${testMethod.methodName}")
}
@After
fun afterTest(){
ScreenshotOnFailure.takeScreenshot("${currentTimeInHumanString}_after_${testMethod.methodName}")
}
@Test
fun createKotlinDslGradleWithKotlin() {
testGradleProjectWithKotlin(
@@ -3,7 +3,11 @@ package com.intellij.ide.projectWizard.kotlin.createProject
import com.intellij.ide.projectWizard.kotlin.model.*
import com.intellij.testGuiFramework.framework.param.GuiTestSuiteParam
import com.intellij.testGuiFramework.impl.ScreenshotOnFailure
import com.intellij.testGuiFramework.util.currentTimeInHumanString
import com.intellij.testGuiFramework.util.scenarios.NewProjectDialogModel
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@@ -20,6 +24,16 @@ class CreateGradleProjectWithKotlinGuiTest(private val testParameters: TestParam
override fun toString() = projectName
}
@Before
fun beforeTest(){
ScreenshotOnFailure.takeScreenshot("${currentTimeInHumanString}_before_${testMethod.methodName}")
}
@After
fun afterTest(){
ScreenshotOnFailure.takeScreenshot("${currentTimeInHumanString}_after_${testMethod.methodName}")
}
@Test
fun createGradleWithKotlin() {
testGradleProjectWithKotlin(
@@ -4,6 +4,7 @@ package com.intellij.testGuiFramework.fixtures
import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame
import com.intellij.testGuiFramework.framework.Timeouts
import com.intellij.testGuiFramework.impl.*
import com.intellij.testGuiFramework.util.currentTimeInHumanString
import com.intellij.testGuiFramework.util.step
import org.fest.swing.core.Robot
import org.fest.swing.exception.ComponentLookupException
@@ -17,6 +18,7 @@ class WelcomeFrameFixture private constructor(robot: Robot,
WelcomeFrameFixture::class.java, robot, target), ContainerFixture<FlatWelcomeFrame> {
fun createNewProject(): WelcomeFrameFixture {
ScreenshotOnFailure.takeScreenshot("${currentTimeInHumanString}_before click Create New Project")
findActionLinkByActionId("WelcomeScreen.CreateNewProject").click()
return this
}