-
Notifications
You must be signed in to change notification settings - Fork 273
ci: Update UI tests to use the 243 release #5388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
9285546
f935c2a
c2f151b
eeda387
1be5c3c
316c0ff
5bbbb25
b42c77e
a64ef19
93b015a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package software.aws.toolkits.jetbrains.uitests | ||
|
|
||
| import com.intellij.driver.sdk.openFile | ||
| import com.intellij.driver.sdk.ui.ui | ||
| import com.intellij.driver.sdk.waitForProjectOpen | ||
| import com.intellij.ide.starter.ci.CIServer | ||
| import com.intellij.ide.starter.di.di | ||
| import com.intellij.ide.starter.driver.engine.runIdeWithDriver | ||
| import com.intellij.ide.starter.ide.IdeProductProvider | ||
| import com.intellij.ide.starter.junit5.hyphenateWithClass | ||
| import com.intellij.ide.starter.models.TestCase | ||
| import com.intellij.ide.starter.project.LocalProjectInfo | ||
| import com.intellij.ide.starter.runner.CurrentTestMethod | ||
| import com.intellij.ide.starter.runner.Starter | ||
| import org.junit.jupiter.api.Test | ||
| import org.junit.jupiter.api.condition.DisabledIfSystemProperty | ||
| import org.kodein.di.DI | ||
| import org.kodein.di.bindSingleton | ||
| import java.io.File | ||
| import java.nio.file.Path | ||
| import java.nio.file.Paths | ||
| import kotlin.io.path.createParentDirectories | ||
| import kotlin.io.path.writeText | ||
|
|
||
| @DisabledIfSystemProperty(named = "org.gradle.project.ideProfileName", matches = "2024.2", disabledReason = "Logging API not present for 242") | ||
| class OfflineAmazonQInlineCompletionTest { | ||
| init { | ||
| di = DI { | ||
| extend(di) | ||
| bindSingleton<CIServer>(overrides = true) { TestCIServer } | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun `completion request with expired credentials does not freeze EDT`() { | ||
| val testCase = TestCase( | ||
| IdeProductProvider.IC, | ||
| LocalProjectInfo( | ||
| Paths.get("tstData", "Hello") | ||
| ) | ||
| ).useRelease("2024.3") | ||
| Paths.get(System.getProperty("user.home"), ".aws", "sso", "cache", "ee1d2538cb8d358377d7661466c866af747a8a3f.json") | ||
| .createParentDirectories() | ||
| .writeText( | ||
| """ | ||
| { | ||
| "clientId": "DummyId", | ||
| "clientSecret": "DummySecret", | ||
| "expiresAt": "3070-01-01T00:00:00Z", | ||
| "scopes": [ | ||
| "scope1", | ||
| "scope2" | ||
| ], | ||
| "issuerUrl": "1", | ||
| "region": "2", | ||
| "clientType": "public", | ||
| "grantTypes": [ | ||
| "authorization_code", | ||
| "refresh_token" | ||
| ], | ||
| "redirectUris": [ | ||
| "http://127.0.0.1/oauth/callback" | ||
| ] | ||
| } | ||
| """.trimIndent() | ||
| ) | ||
| Paths.get(System.getProperty("user.home"), ".aws", "sso", "cache", "d3b447f809607422aac1470dd17fbb32e358cdb3.json") | ||
| .writeText( | ||
| """ | ||
| { | ||
| "issuerUrl": "https://example.awsapps.com/start", | ||
| "region": "us-east-1", | ||
| "accessToken": "DummyAccessToken", | ||
| "refreshToken": "RefreshToken", | ||
| "createdAt": "1970-01-01T00:00:00Z", | ||
| "expiresAt": "1970-01-01T00:00:00Z" | ||
| } | ||
| """.trimIndent() | ||
| ) | ||
| Starter.newContext(CurrentTestMethod.hyphenateWithClass(), testCase).apply { | ||
| System.getProperty("ui.test.plugins").split(File.pathSeparator).forEach { path -> | ||
| pluginConfigurator.installPluginFromPath( | ||
| Path.of(path) | ||
| ) | ||
| } | ||
|
|
||
| copyExistingConfig(Paths.get("tstData", "config")) | ||
| updateGeneralSettings() | ||
| }.runIdeWithDriver() | ||
| .useDriverAndCloseIde { | ||
| waitForProjectOpen() | ||
| openFile("Example.java") | ||
| ui.keyboard { | ||
| // left meta + c | ||
| repeat(5) { hotKey(18, 67) } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package software.aws.toolkits.jetbrains.uitests | ||
|
|
||
| import com.intellij.driver.sdk.openFile | ||
| import com.intellij.driver.sdk.ui.ui | ||
| import com.intellij.driver.sdk.waitForProjectOpen | ||
| import com.intellij.ide.starter.ci.CIServer | ||
| import com.intellij.ide.starter.config.ConfigurationStorage | ||
| import com.intellij.ide.starter.config.logEnvironmentVariables | ||
| import com.intellij.ide.starter.di.di | ||
| import com.intellij.ide.starter.driver.engine.runIdeWithDriver | ||
| import com.intellij.ide.starter.ide.IdeProductProvider | ||
|
|
@@ -28,6 +30,7 @@ class OfflineAmazonQInlineCompletionTest { | |
| di = DI { | ||
| extend(di) | ||
| bindSingleton<CIServer>(overrides = true) { TestCIServer } | ||
| ConfigurationStorage.Companion.logEnvironmentVariables(false) | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
@@ -38,7 +41,7 @@ class OfflineAmazonQInlineCompletionTest { | |
| LocalProjectInfo( | ||
| Paths.get("tstData", "Hello") | ||
| ) | ||
| ).useRelease("2024.2") | ||
| ).useRelease("2024.3") | ||
manodnyab marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Paths.get(System.getProperty("user.home"), ".aws", "sso", "cache", "ee1d2538cb8d358377d7661466c866af747a8a3f.json") | ||
| .createParentDirectories() | ||
| .writeText( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.