Skip to content

Conversation

stevemessick
Copy link
Member

This includes a test for hot reload that uses the inspector to verify it actually worked. Pretty cool, I think :)

I added a bunch of step calls that wrap a block and log a message. Generally, if the first line of the diff starts with "step" then the only change is indentation.

@pq @jacob314

@stevemessick stevemessick requested a review from pq April 16, 2019 20:58
Copy link
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome. A few questions mainly...

inner class InspectorPanelFixture(val inspectorPanel: InspectorPanel) {
// The InspectorPanel is a little tricky to work with. In order for the tree to have content its view must be made
// visible (either Widgets or Render Tree). However, we don't want to return a reference to an empty tree, because
// of timing issues. We use the fact that the tree has content as a signal to move on to the next step.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These notes are super clarifying. Thanks for the comments! :)

@jacob314: knowing the inspector internals, does this sound like a reasonable approach to you?


fun selectRow(number: Int, expand: Boolean = true) {
waitForContent()
treeFixture().clickRow(number) // This should not collapse the tree, but it does.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a fixture bug or in the inspector?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like an off-by-one error. The click occurs exactly on the left-side boundary of the row bounding box. That rectangle apparently overlaps the bounding box of the triangle icon that expands and collapses the sub-tree. I don't think it is a framework error because I can, with sufficient care, reproduce the problem manually. OTOH if the click was in the center of the bounding box there'd be no problem, but that's a choice made by fest, a library used by the testing framework.


private fun IdeFrameFixture.findActionButtonByActionId(actionId: String): ActionButtonFixture {
private fun findActionButtonByActionId(actionId: String): ActionButtonFixture {
// This seems to be broken, but finding by simple class name works.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bummer. But I guess since we own all the classes under test, not a big deal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the problem is. I haven't even ruled out pilot error (hmm, that may not be a great idiom these days). It might be a bug in the framework. I keep this around to remind myself not to use it.

Copy link
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@stevemessick stevemessick merged commit 815639e into master Apr 17, 2019
@stevemessick stevemessick deleted the inspector-mod branch April 17, 2019 14:38
alexander-doroshko pushed a commit to alexander-doroshko/flutter-intellij that referenced this pull request Jan 24, 2020
* Add a test to verify correctness of hot reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants