From fc2fcfca59cd317d8fcc9c4083ec445cd21975bc Mon Sep 17 00:00:00 2001 From: Vladislav Shishov Date: Thu, 17 Jan 2019 14:46:08 +0300 Subject: [PATCH] [gui-test] fix first start --- .../testGuiFramework/impl/FirstStart.kt | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/FirstStart.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/FirstStart.kt index f6fc3a583955..3e1ec104cc94 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/FirstStart.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/FirstStart.kt @@ -42,8 +42,6 @@ abstract class FirstStart(val ideType: IdeType) { private val FIRST_START_ROBOT_THREAD = "First Start Robot Thread" - private val LOG = Logger.getInstance(this.javaClass.name) - val myRobot: Robot private val robotThread: Thread = thread(start = false, name = FIRST_START_ROBOT_THREAD) { @@ -85,7 +83,7 @@ abstract class FirstStart(val ideType: IdeType) { init { myRobot = SmartWaitRobot() - LOG.info("Starting separated thread: '$FIRST_START_ROBOT_THREAD' to complete initial installation") + println("Starting separated thread: '$FIRST_START_ROBOT_THREAD' to complete initial installation") robotThread.start() } @@ -111,7 +109,7 @@ abstract class FirstStart(val ideType: IdeType) { fun Frame.close() = myRobot.close(this) fun findWelcomeFrame(seconds: Int = 5): Frame? { - LOG.info("Waiting for a Welcome Frame") + println("Waiting for a Welcome Frame") silentWaitUntil("Welcome Frame to show up", seconds) { Frame.getFrames().any { checkIsWelcomeFrame(it) } } @@ -135,28 +133,29 @@ abstract class FirstStart(val ideType: IdeType) { open fun acceptAgreement() { if (!needToShowAgreement()) return try { - LOG.info("Waiting for License Agreement/Privacy Policy dialog") + println("Waiting for License Agreement/Privacy Policy dialog") findPrivacyPolicyDialogOrLicenseAgreement() with(JDialogFixture(myRobot, findPrivacyPolicyDialogOrLicenseAgreement())) { click() checkboxContainingText("i confirm", true, Timeouts.noTimeout).select() - LOG.info("Accept License Agreement/Privacy Policy dialog") + println("Accept License Agreement/Privacy Policy dialog") button("Continue", Timeouts.seconds05).click() } } catch (e: WaitTimedOutError) { - LOG.warn("'License Agreement/Privacy Policy dialog hasn't been shown. Check registry...") + println("'License Agreement/Privacy Policy dialog hasn't been shown. Check registry...") } } open fun completeInstallation() { if (!needToShowCompleteInstallation()) return with(myRobot) { - val title = "Complete Installation" - LOG.info("Waiting for '$title' dialog") - val dialogFixture = dialog(title) + println("Waiting for 'import settings' dialog") + val dialogFixture = dialog { + it.startsWith("Import") + } - LOG.info("Click OK on 'Do not import settings'") + println("Click OK on 'Do not import settings'") dialogFixture.radioButton("Do not import settings").select() repeatUntil( @@ -168,15 +167,15 @@ abstract class FirstStart(val ideType: IdeType) { open fun acceptDataSharing() { with(myRobot) { - LOG.info("Accepting Data Sharing") + println("Accepting Data Sharing") val title = "Data Sharing" try { dialog(title, timeout = Timeouts.seconds05) button("Send Usage Statistics").click() - LOG.info("Data sharing accepted") + println("Data sharing accepted") } catch (e: WaitTimedOutError) { - LOG.info("Data sharing dialog hasn't been shown") + println("Data sharing dialog hasn't been shown") return } } @@ -186,10 +185,10 @@ abstract class FirstStart(val ideType: IdeType) { if (!needToShowCustomizeWizard()) return with(myRobot) { val title = "Customize $ideName" - LOG.info("Waiting for '$title' dialog") + println("Waiting for '$title' dialog") dialog(title) val buttonText = "Skip Remaining and Set Defaults" - LOG.info("Click '$buttonText'") + println("Click '$buttonText'") button(buttonText).click() } } @@ -197,20 +196,20 @@ abstract class FirstStart(val ideType: IdeType) { open fun evaluateLicense(ideName: String, robot: Robot) { with(robot) { val licenseActivationFrameTitle = "$ideName License Activation" - LOG.info("Waiting for '$licenseActivationFrameTitle' dialog") + println("Waiting for '$licenseActivationFrameTitle' dialog") try { waitFrame(licenseActivationFrameTitle) { it == licenseActivationFrameTitle } radioButton("Evaluate for free").select() val evaluateButton = button("Evaluate") GuiTestUtilKt.waitUntil("activate button will be enabled") { evaluateButton.isEnabled } - LOG.info("Click '${evaluateButton.text()}'") + println("Click '${evaluateButton.text()}'") evaluateButton.click() dialog(timeout = Timeouts.seconds10) { it.startsWith("License Agreement for") } button("Accept").click() } catch (waitTimedOutError: WaitTimedOutError) { - LOG.info("No License Activation dialog has been found") + println("No License Activation dialog has been found") } } }