Skip to content

Added Squish tests#886

Merged
vadi2 merged 13 commits intoMudlet:developmentfrom
vadi2:development-squish-tests
Apr 27, 2017
Merged

Added Squish tests#886
vadi2 merged 13 commits intoMudlet:developmentfrom
vadi2:development-squish-tests

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Apr 13, 2017

froglogic gave us an open-source license to Squish for Qt, a pretty nice GUI automation tool and as far as I see the best one out there for Qt apps.

This is an initial set of tests that pretty much test that you can open a profile and create a basic profile. We should strive to get all GUI aspects of using Mudlet into this so we can safely tweak things and not be afraid of breaking something. A video demonstration of these tests can be found here.

The license for Squish per-user, so if you'd like to work on these tests (please do!), you'll need to sign up for an evaluation license to get immediate access to the tool - and I can get a more permanent license after.

Tagging @Mudlet/infrastructure for review.

@vadi2 vadi2 self-assigned this Apr 13, 2017
@vadi2 vadi2 requested a review from keneanung April 13, 2017 12:20
@ahmedcharles
Copy link
Copy Markdown
Contributor

This is just adding tests, not running them, right?

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 14, 2017

Yeah, this doesn't run them through TravisCI. @keneanung at some point will hook them up I imagine, I'll worry about making them and running them locally.

@keneanung
Copy link
Copy Markdown
Member

This looks like a very nice tool! There are some niggles right now:

  • I needed to manually tell squish where the Mudlet executable is and there is no was to include that in the project files. We should document the how or at least refer new users to https://doc.froglogic.com/squish/6.2/rg-autsettings.html#rgas-pathmapped
  • Using strict screenshot comparison made the tests fail on my machine because there were minimal (like 0.057% and 0.0006%) differences. We'll probably want to use a threshold of around 0.1-0.5% for differences.
  • In one test run, I had an additional newline in the tst_2_make_triggers test, which made the test fail. I wonder why and if we can be a little more flexible here...

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 24, 2017

Yeah, you have to map the executable.

I ran into the same issue with screenshot comparison mode - I made a little script to prune identical images and ended up with this set of images:

failed_98
failed_59
failed_33
failed_12
failed_9
failed_3
failed_1

I think a solution to this would be if we could tell squish to look for an image anywhere within an image - instead of just a static mask that blocks out other parts for comparison. That would solve our problem. I haven't found out how yet though nor written to their mailing list about it.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 24, 2017

Oh yeah, though one obvious solution is to have a profile that doesn't connect to a MUD - just putting in example.com:23. Then we should have a static output - so we'd solve the problem in this case but not necessarily for other cases.

@keneanung
Copy link
Copy Markdown
Member

Does this allow to check for certain colours in the text?

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Apr 24, 2017

Vadim wrote:

Oh yeah, though one obvious solution is to have a profile that doesn't connect to a MUD - just putting in example.com:23...

I just use localhost:23 ... 😀

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 24, 2017

@keneanung via screenshot comparison

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 25, 2017

I need to work on this branch while also having access to the improvements done in #955 @keneanung anything you'd like me to do on this branch?

I'll be swapping out Avalon.de with a blank profile that the BDD creates as a setup hook so we can avoid the connection timing issues - just used that profile as a starting point because it was there already.

@keneanung
Copy link
Copy Markdown
Member

Nothing else right now. We may need to decide about BDD or scripted tests and some other guidelines when we have a little more experience with the tool, but I don't think it's something we can decide right now.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 25, 2017

Okay, tick please

Copy link
Copy Markdown
Member

@keneanung keneanung left a comment

Choose a reason for hiding this comment

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

I wanted to wait for the new profile code before the tick, but I guess you want to add it to the coroutine tests.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 25, 2017

Ahh sure, my bad. I will add it in first!

vadi2 added 2 commits April 27, 2017 09:41
Still has a few kinks - need to figure out how to create Qt objects - but it does the job fine for what's needed right now.
@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 27, 2017

@keneanung added. Haven't migrated other tests to BDD yet to make use of the Squish profile - that'll come later.

I think we should go BDD because it's a heck of a lot easier to understand tests written in English than in code for test newbies, and I'd like to get any interested people in contributring - so the bar's gotta be pretty damn low.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Apr 27, 2017

I'll leave porting the other tests to BDD later, want to get started on testing #955.

Copy link
Copy Markdown
Member

@keneanung keneanung left a comment

Choose a reason for hiding this comment

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

Confirming my approval. Check it in!

@vadi2 vadi2 merged commit 7aabee6 into Mudlet:development Apr 27, 2017
@vadi2 vadi2 deleted the development-squish-tests branch April 27, 2017 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants