-
Notifications
You must be signed in to change notification settings - Fork 20
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
Smoke test for Skate Plugin #468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start! Do you think we can set up a test that does the following
- Writes a sample changelog file to the project dir (before opening the project)
- Writes the setting to the skate config
- Opens the project
- Asserts that the panel opened and showed the changelog
|
||
class SkatePluginInitializationTest : BasePlatformTestCase() { | ||
|
||
fun `test Skate Plugin Service Initialization to ensure SkateProjectService is properly registered & initialized`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test run without @Test
on it?
|
||
fun `test Skate Plugin Service Initialization to ensure SkateProjectService is properly registered & initialized`() { | ||
val skateService = project.service<SkateProjectService>() | ||
assertTrue( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the Truth
assertion APIs like we do in other unit tests?
service.showWhatsNewWindow() | ||
} | ||
|
||
fun `test Tool Window Exists`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here re: @Test
override fun tearDown() { | ||
super.tearDown() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be implemented since we don't do anything extra?
|
||
val toolWindowRegistered = toolWindowManager.getToolWindow(toolWindowId) | ||
|
||
TestCase.assertNotNull("Tool Window doesn't exist", toolWindowRegistered) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here re: using Truth
…settings to the skate config, opens the project, and asserts the panel is open
I wrote a test in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a test in SkatePluginTest.kt that addresses these, and also wrote a test in SkatePluginInitializationTest.kt separating the settings configuration. The test in the initialization file pass, but it's stating that toolWindow is null when I test that the panel opens up. I am not sure if I am referring to the tool window wrong in my test?
Not sure, you'll need to figure it out :). I suspect it's running headlessly so there's no window open, so we'd need to see how to test it with UI
settings.whatsNewFilePath = changelogFile.absolutePath | ||
|
||
val skateService = project.service<SkateProjectService>() | ||
skateService.showWhatsNewWindow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin should do thus automatically when we open the project, right? Otherwise our test is implementing what we're trying to test
val skateService = project.service<SkateProjectService>() | ||
skateService.showWhatsNewWindow() | ||
|
||
// account for async functions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this referencing?
…/smoke_test Please enter a commit message to explain why this merge is necessary, just merged main
Gonna close this out for now and we'll revisit in the future! |
No description provided.