Skip to content
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 Jest UI tests and making UI more stable #1369

Open
2 of 9 tasks
keshav234156 opened this issue Dec 18, 2019 · 28 comments
Open
2 of 9 tasks

Writing more Jest UI tests and making UI more stable #1369

keshav234156 opened this issue Dec 18, 2019 · 28 comments

Comments

@keshav234156
Copy link
Member

keshav234156 commented Dec 18, 2019

With #1366 we were able to set up a basic browser-based UI test and it works flawlessly. So lets build more tests and make the UI stable.
Test yet to be built:

  • (Reserved For GCI ) Clicking add step adds a new box and a different image(add tests for bottom step button #1387 )
  • Clicking clear step button clear all the step
  • Clicking Delete Step removes the image(Fixed within Blend new #1499 )
  • (Reserved For GCI ) Select a module to have all the modules with the correct name(we faced issues when modules have which is undefined in the past ).
  • Insert step works as expected.
  • Input types(range,text etc) of all the modules are correct-
    we need to fix this before we can write test on it
  • add a UI test for the test which check that all the modules the default options are displayed(FIX: Histogram module selected value not displayed #1510 )
@keshav234156
Copy link
Member Author

cc:-@jywarren @harshkhandeparkar we can add more tests as we go along the way but these are most basic set of tests that are needed.

@jywarren
Copy link
Member

jywarren commented Dec 18, 2019 via email

@ataata107
Copy link

I am new here and would love to work on this.

@jywarren
Copy link
Member

jywarren commented Dec 18, 2019 via email

@ataata107
Copy link

I will start with the basic ones like clear step button and remove step button and would start building from it. Thanks for the opportunity.

@SidharthBansal
Copy link
Member

I have published this on gci dashboard

@SidharthBansal
Copy link
Member

Thanks Keshav

@harshkhandeparkar
Copy link
Member

@jywarren sure. The new UI will just be less messy and it is coming together really well. I think I do not need to add the E2E tests which would require headless browsers. I will just add the unit tests with perhaps a virtual DOM. Is that ok? We can use the tests we are developing here, there.

We won't have to migrate anything, we can just copy the dist from there and use grunt here.

@pythongiant
Copy link

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);
    expect(previousLength).toBe(1);
    expect(previousLength1).toBe(2);
  }, timeout);
});

Doesnt this check if a new step is added? @keshav234156 i am just a beginner sorry if i am missing something.

@pythongiant
Copy link

I would like to work on clear step test, Thanks

@keshav234156
Copy link
Member Author

@pythongiant This piece of code tests that when the radio button is clicked a new step is added and length is increased . In the GCI task, you have test when we select a value from the dropdown and click ADD STEP a new is added and src of the previous step is different from src of the present step. @ataata107 is already working on the Clear step.

@pythongiant
Copy link

Thanks for the explaination @keshav234156 i must have skipped @ataata107 comment by mistake. Sorry bout that. Can i work on delete one?

@keshav234156
Copy link
Member Author

keshav234156 commented Dec 22, 2019

@pythongiant It's easy.I will help you here .
with $("[data-value='blur']").click() You would be able to set dropdown value to blur
with $("#add-step-btn").click() you can click ADD STEP button

Now just check that length has increased as done above
and check src of both step is different

@ataata107 ataata107 mentioned this issue Dec 22, 2019
5 tasks
@rcya1
Copy link

rcya1 commented Dec 22, 2019

I am currently working on the 4th one (Select a module dropdown having the correct names). I claimed the corresponding task on the GCI dashboard.

@keshav234156
Copy link
Member Author

@pythongiant Are you still stuck? Feel free to ask any doubt related to the task.
@Ryan10145 great!!!

@pythongiant
Copy link

image
@keshav234156 we are talking about this button right?

@keshav234156
Copy link
Member Author

keshav234156 commented Dec 23, 2019

@pythongiant No,This is Add step button of insert Button.We are talking of ADD STEPbutton at the bottom.

@pythongiant
Copy link

image
this one then?

@keshav234156
Copy link
Member Author

@pythongiant Yes

@rcya1
Copy link

rcya1 commented Dec 26, 2019

Due to holiday celebrations and other commitments, I wasn't able to work on this for the last few days like I thought I would be able to. I also won't be able to work on it in the near future, so I am giving up the task and leaving it up for anyone to claim. Sorry for the unfortunate news.

@ataata107
Copy link

@pythongiant Are you working on the delete step?

@pythongiant
Copy link

Nope @ataata107

@ataata107
Copy link

Ok I will start working on it

@jywarren jywarren mentioned this issue Jan 2, 2020
5 tasks
@jywarren
Copy link
Member

Hi all, this is coming along really well and I wanted to thank everyone for your help. This is doing a huge amount to stabilize our project!

@jywarren
Copy link
Member

Noting Apply button test is ready in #1579, and maybe we need to update what still needs tests?

@jywarren
Copy link
Member

One could be - a test of which steps get refreshed when we modify things. To ensure that only those tests that are "after" a change get refreshed; i think i've seen some unnecessary step reruns in manual testing.

Others we could test for?

@jywarren
Copy link
Member

jywarren commented Jul 12, 2020

Noting a few that've been observed and we should test for in Jest:

Others we want to copy in here?

@jywarren jywarren changed the title Writing UI test and making UI more stable Writing more Jest UI tests and making UI more stable Jul 12, 2020
@jywarren jywarren pinned this issue Jul 12, 2020
@jywarren
Copy link
Member

Maybe we should check in on whether some of these tests have been written and could be checked off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants