-
Notifications
You must be signed in to change notification settings - Fork 122
Add high priority and mixed formatting UI tests #521
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
Conversation
| .insertMedia() | ||
|
|
||
| // Must wait for simulated upload | ||
| Thread.sleep(10000) |
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.
10s is quite a large delay. There no way to dynamically check if the upload is done?
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 was using the same general approach that was used in the previously added image tests with that sleep, but I can take another look to see what options there might be to dynamically check the upload status.
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 simulated upload in the demo app takes 10s, so I'm going to leave this as-is for our Aztec tests. I'll look at a more dynamic approach for the WordPress app tests.
|
|
||
| for (i in 1..3) { | ||
| text += text | ||
| } |
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.
Is this for cycle is needed? I think a simple string with multiple \n would make the test easier to read.
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.
Good thought. I like the for loop for keeping things clean when we need a really long string, but I can probably just use a single string here.
| @Test | ||
| fun testQuotedListFormatting() { | ||
| var text = "some text\n" | ||
| val regex = Regex("<blockquote>\\s+<ul>[\\S\\s]+</ul>\\s+</blockquote>") |
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'm not aware how Regex is working in Kotlin/Java but I've able to make it work after removing escaped \:
<blockquote>\s+<ul>[\S\s]+<\/ul>\s+<\/blockquote>
was matched:
<blockquote>
<ul>
<li>Wee</li>
<li>Add</li>
<li>Xox</li>
</ul>
</blockquote>
Tested here: https://regexr.com/
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 backslashes need to be escaped per the pattern syntax. I'm not sure why the escaped version wouldn't work for you (although I'm also looking into stripping whitespace characters between HTML tags in our matchers for these tests, which will allow us to remove some of the regex here).
brbrr
left a comment
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 like the cleanness of your tests and changes, and everything looks nice and smooth! Good job 👍
|
Ok, I think the tests in this PR are complete. @maxme could you review this as well? I'm going to look into adding some better link tests but I'll do that in a followup PR so I don't delay getting these high priority tests merged. |
|
Test looks good, but do you mind implementing It would be great if we could get this instead: I can merge that PR and fill a ticket if you prefer. |
|
Good idea. I looked at making that change to the output and it isn't working the way I expect it to, so I'll need to investigate how to implement that correctly. Let's go ahead and merge this PR and I'll follow up on the output message enhancement with this ticket: #531 |
|
|
To Test
Build and run the instrumentation tests, e.g. with
./gradlew cAT(see README for details).Note that
testRetainParagraphFormattingcurrently fails but will be resolved by #483.