-
Notifications
You must be signed in to change notification settings - Fork 210
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
Writing more UI tests (with guidance) #1000
Comments
For example, we should be able to input settings using something like But first, we'll need to add more unique CSS classnames so that we can make calls like that in jQuery. Right now, they're too generic: <div class="panel-body cal collapse in">
<div class="row step">
<div class="col-md-4 details">
<h3><span class="load-spin" style="display:none;"><i class="fa fa-circle-o-notch fa-spin"></i></span></h3>
<div class="cal collapse in"><p><i>Change the contrast of the image by given value</i></p></div>
<div class="row" name="contrast">
<div class="det cal collapse in">
<label for="contrast">contrast for the new image, typically -100 to 100</label>
<input class="form-control target" type="range" name="contrast" value="70" placeholder="" min="-100" max="100" step="1"> |
I'd like to take this up. This would be kind of a quest, adding UI tests as we go deeper into implementing more features for IS. Would like to start with some basic tests |
:-) great! And love the idea of a test-quest! You might like this fun
project i once did:
http://pxlqst.com/test (https://github.com/jywarren/pxlqst)
…On Mon, Apr 8, 2019 at 7:29 PM Vibhor Gupta ***@***.***> wrote:
I'd like to take this up. This would be kind of a quest, adding UI tests
as we go deeper into implementing more features for IS. Would like to start
with some basic tests
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1000 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ-Jioj6j7ws-PraIvb1iYK8g4AgLks5ve9C8gaJpZM4cjH8N>
.
|
Nice! I'll get on with improving some tests I already wrote while setting up the UI testing harness. Also, apologies for shamelessly plugging in my proposal, but trying to make it as comprehensive as possible. What are the chances I'll get reviewed, should I submit one in a couple of hours? It's early morning here, trying to churn it out as fast as I can. Thanks! |
It's very close to the deadline - we will read it for sure, but not sure if
it'll be in time to file a revision! But thank you!!!
…On Mon, Apr 8, 2019 at 7:50 PM Vibhor Gupta ***@***.***> wrote:
Nice! I'll get on with improving some tests I already wrote while setting
up the UI testing harness.
Rendering of buttons and steps should be a nice starting point.
Also, apologies for shamelessly plugging in my proposal, but trying to
make it as comprehensive as possible. What are the chances I'll get
reviewed, should I submit one in a couple of hours? Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1000 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ-Po1uL4LEhfllLZklngs5YuBRbhks5ve9W0gaJpZM4cjH8N>
.
|
Hi Harsh! I want to work on UI testing and would love to look into!! |
@jywarren again, apologies for the plug, I sent over the commentable link to my proposal to you on Gitter. My proposal on publiclab.org says I'll be notified via mail once my proposal gets published. It is way too late for reviews, but the link is on Gitter for your reference. Thanks! |
I would love to work on this issue |
sure go ahead |
Yes please go ahead!
I would love to collaborate on this.
…On Fri 30 Aug, 2019, 10:26 PM Rishabh Shukla, ***@***.***> wrote:
I would love to work on this issue
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#1000?email_source=notifications&email_token=AHOHJL6RFD4HPNUUM7BXUWDQHFGKPA5CNFSM4HEMP4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5SGOIA#issuecomment-526673696>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHOHJL7KO2SQCM4QJ7YDG3TQHFGKPANCNFSM4HEMP4GQ>
.
|
Much ❤️ to you all!!! Shall we make a checklist of UI actions that could be tested for?
These could be largely independent from the UI implementation as long as the add step, delete step, insert step elements have standard classnames! (update: checked boxes above) |
Also updated location of existing UI tests! https://github.com/publiclab/image-sequencer/tree/main/test/ui/spec |
Here is the most likely section for the listed tests above! image-sequencer/test/ui/spec/defaultHtmlSequencerUi.spec.js Lines 27 to 41 in 3741d67
Note that we are not yet testing click events and such. I think the tests are just really minimal stubs, confirming that the UI was set up, but not testing that it works, is that right? Also:
|
As I discussed with Pranshu, he suggested that testing with Jest along with puppeteer is a good way to proceed here. |
Hi! I'm not against a weighing of pros/cons to switching test libraries, but is there a problem with the current test setup that you're interested in addressing by switching? |
Gaah! I accidentally committed to However, you can see a very clear UI test that is only 3 lines, for the quick selector! cc @harshithpabbati @Divy123 @rexagod @blurry-x-face |
I apologize for the mistake, i'll revert it as soon as it fails, but will open it in a new PR. |
Reverted, now working on it at: #1242 To address #1238, which Harsh identified, it would be something like: it('allows changing brightness value using input and Apply button', function() {
$("[data-value='brightness']").click();
var brightnessImage1 = $('.step:last img')[0].src;
$('.step:last input.form-control').val('25%'); // change the value
$('.step:last .btn-save').click(); // apply the change
var brightnessImage2 = $('.step:last img')[0].src;
expect(brightnessImage1).not.toEqual(brightnessImage2);
}); |
Does this makes sense to you all? cc @publiclab/is-reviewers Thanks! |
@jywarren I am claiming it now. Let us work on it together.! The UI needs to be stable. Will make a PR for this super soon. |
Closing this in favor of #1369 now! |
We need more UI tests to protect and stabilize the UI behaviors of the demo, so that we know when refactors and new features break things. This will build overall stability in the system and let us do more advanced work without chasing bugs. Bugs are natural! No worries! But we can catch them before they get published using more tests.
Our UI tests can be found here: https://github.com/publiclab/image-sequencer/tree/main/test/ui/spec
Instead of testing core functions with unit tests, they set up an HTML environment and simulate someone actually using the buttons and UI.
So in one of these test files, or a new one, we should be able to begin interacting with a full Sequencer UI, by selecting things in the Add Modules select, clicking buttons with
$('.btn .uniqueClass').trigger('click');
(or something like that) and then using assertions to test that things really happened, something like this:This way, we can have more confidence in the UI not breaking. We'd love help with this! I know @harshithpabbati asked a bit about how this might work. Want to try it out?
Once we have one simple test like this, we can use it as a model to add more like it, and get to higher test coverage of our UI code!
The text was updated successfully, but these errors were encountered: