-
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
Basic UI tests -- initial one for quick selector add step #1242
Conversation
Needs clicking |
Actually no, the quick selector doesn't need an Add Step click. So maybe the lib is not fully set up here yet... |
We need a fixture to have an HTML page to work on. |
@@ -4,6 +4,10 @@ describe('Default sequencer HTML', function() { | |||
var sequencer = require('../../../src/ImageSequencer')(); |
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.
So, here it looks like this is already done in the default UI code. So maybe we need to split this into another file to have one running purely on the fixture file.
OK, so, managed to get the fixtures loading. But, I can't seem to get the libraries themselves to load. I'm seeing: ReferenceError: Can't find variable: initializeSequencerUi in file:///home/warren/sites/image-sequencer/test/ui/spec/basicUi.spec.js (line 6) (1) It's odd. I can't get ImageSequencer to load either, despite it's inclusion in the Gruntfile. I also tried using a Basing this on https://github.com/publiclab/PublicLab.Editor/blob/master/spec/javascripts/editor_spec.js and https://github.com/publiclab/PublicLab.Editor/blob/master/Gruntfile.js @publiclab/is-reviewers any suggestions? |
Hi @ananyaarun -- i'm struggling a bit getting these tests to run. I was wondering if you'd be able to look at it since you so recently got this running in LEL? Have I overlooked something simple? |
Hey @jywarren , sure I'll give it a look. |
@Divy123 @harshkhandeparkar @rexagod any ideas here? :-/ |
Referencing this similar PR from another project: publiclab/leaflet-environmental-layers#247 |
Could it relate to these includes in the file @sagarpreet-chadha set up over in |
@jywarren May I help here? |
@vaibhavmatta i'd love help, sorry I didn't see this! I'm just trying to get the most basic browser-based tests running that we can build on! |
@jywarren I think basic browser-based tests won't work so efficiently. But still, if you say, I would love to work on them as well.! Thanks 🙂 |
Well, we really need browser-based tests of the UI buttons, as they keep
breaking. We won't do the entire suite of tests here, but just a few
critical ones to ensure the HTML UI is stable. Thanks!!!
…On Mon, Nov 18, 2019 at 1:44 PM VAIBHAV MATTA ***@***.***> wrote:
@jywarren <https://github.com/jywarren> I think basic browser-based tests
won't work so efficiently. But if you say, I would love to work on them as
well.! Thanks 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1242?email_source=notifications&email_token=AAAF6J7ITMGOPNXAYGEJRFTQULO6DA5CNFSM4ISX4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEELPNAA#issuecomment-555153024>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J7DSUWRV4KEHV7SM4DQULO6DANCNFSM4ISX4JVQ>
.
|
Alright.! I got you 🙂
On Tue, Nov 19, 2019, 11:21 PM Jeffrey Warren <[email protected]>
wrote:
… Well, we really need browser-based tests of the UI buttons, as they keep
breaking. We won't do the entire suite of tests here, but just a few
critical ones to ensure the HTML UI is stable. Thanks!!!
On Mon, Nov 18, 2019 at 1:44 PM VAIBHAV MATTA ***@***.***>
wrote:
> @jywarren <https://github.com/jywarren> I think basic browser-based
tests
> won't work so efficiently. But if you say, I would love to work on them
as
> well.! Thanks 🙂
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#1242?email_source=notifications&email_token=AAAF6J7ITMGOPNXAYGEJRFTQULO6DA5CNFSM4ISX4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEELPNAA#issuecomment-555153024
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAAF6J7DSUWRV4KEHV7SM4DQULO6DANCNFSM4ISX4JVQ
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1242?email_source=notifications&email_token=AMDRYMY5AELZ7XJXR7IDH7LQUQRSZA5CNFSM4ISX4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEPDIXY#issuecomment-555627615>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMDRYMZMVJTX3IT5J5AE7U3QUQRSZANCNFSM4ISX4JVQ>
.
|
@keshav234156 is interested in doing this |
That would be amazing.
…On Mon, Dec 16, 2019 at 12:02 PM Sidharth Bansal ***@***.***> wrote:
@keshav234156 <https://github.com/keshav234156> is interested in doing
this
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1242?email_source=notifications&email_token=AAAF6JYLJMNYVLRF2LSSMH3QY6YC3A5CNFSM4ISX4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG7MHWI#issuecomment-566150105>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J5U4N3FXFH6LCYMJ33QY6YC3ANCNFSM4ISX4JVQ>
.
|
@jywarren @SidharthBansal So I was able to test basic add a step functionality
output file
I have done it with the jest puppeteer . I found this as the most suitable here. So we won't require ant HTML fixtures as all the things would be done in headless chrome. What are your view's on this |
Omg can you share a PR? This would be amazing!!!!!!!!
…On Mon, Dec 16, 2019, 8:40 PM keshav234156 ***@***.***> wrote:
@jywarren <https://github.com/jywarren> @SidharthBansal
<https://github.com/SidharthBansal> So I was able to test basic add a
step functionality
test file
const timeout = process.env.SLOWMO ? 30000 : 10000;
beforeAll(async () => {
await page.goto("http://192.168.43.171:3000/examples/#steps=", {waitUntil: 'domcontentloaded'});
});
describe('title of the page', () => {
test('Title of the page', async () => {
const title = await page.title();
expect(title).toBe('Image Sequencer');
}, timeout);
});
describe('Add step', () => {
test('length is increased', async () => {
await page.waitForSelector('.step');
const previousLength = await page.evaluate(() => document.querySelectorAll('.step').length);
await page.click("[data-value='brightness']")
const previousLength1 = await page.evaluate(() => document.querySelectorAll('.step').length);
console.log(previousLength)
console.log(previousLength1)
expect(previousLength).toBe(1);
expect(previousLength1).toBe(2);
}, timeout);
});
output file
> ***@***.*** test /home/keshav/image-sequencer
> jest
PASS src/test/frontend.test.js
title of the page
✓ Title of the page (10ms)
Add step
✓ length is increased (2269ms)
console.log src/test/frontend.test.js:20
1
console.log src/test/frontend.test.js:21
2
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 3.804s, estimated 4s
Ran all test suites.
I have done it with the jest puppeteer . I found this as the most suitable
here. So we won't require ant HTML fixtures as all the things would be done
in headless chrome. What are your view's on this
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1242?email_source=notifications&email_token=AAAF6J4EIWS24N5YFQWEQXLQZAU2FA5CNFSM4ISX4JV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHA226I#issuecomment-566340985>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J2IZ3GGOUZXLR73QN3QZAU2FANCNFSM4ISX4JVQ>
.
|
Solved in #1366 ! |
Seriously, @vaibhavmatta ?? Is this the right platform for this? |
re #1000