ubiquity-dollar icon indicating copy to clipboard operation
ubiquity-dollar copied to clipboard

UI Test CI

Open 0x4007 opened this issue 3 years ago • 42 comments

Depends on https://github.com/ubiquity/ubiquity-dollar/issues/833

We should prepare UI smoke tests that check that there are no console errors when a new page is opened.

As a part of this issue we should create a new github workflow that runs UI smoke tests (using https://github.com/ubiquity/scraper-kernel) that check that there are no console errors when the following web pages are opened:

  1. Home (https://uad.ubq.fi/)
  2. Markets (https://uad.ubq.fi/markets)
  3. Pool (implemented in https://github.com/ubiquity/ubiquity-dollar/issues/833)

Original description: We should setup Puppeteer on CI to open every view and look for thrown errors.

  1. We can iteratively improve the sophistication of the UI tests, but I think this could catch some low hanging fruit/errors.
  2. Next we could click all buttons and look for errors.

Inspired by: https://github.com/ubiquity/ubiquity-dollar/issues/253

I have a really good scraper kernel here.

0x4007 avatar Sep 12 '22 17:09 0x4007

You can assign this to me.

codeawayaks avatar Sep 26 '22 12:09 codeawayaks

You can assign this to me.

@codeawayaks You commented on 20+ GitHub issues that you want to take it. One developer should solve one bounty at a time to minimize blocking other developers to effectively move forward. Which 1 bounty do you want to take?

sergfeldman avatar Sep 27 '22 18:09 sergfeldman

@sergfeldman you can assign this issue to me

pwilson77 avatar Oct 09 '22 19:10 pwilson77

Can you take a look at the kernel and let me know if you have questions before accepting the bounty? To be honest I think I'll need to work directly with you to make this go smoothly. You're probably going to need to be familiar with Puppeteer to perform well on this.

0x4007 avatar Oct 09 '22 20:10 0x4007

Sure let me take a look at the kernel

pwilson77 avatar Oct 09 '22 22:10 pwilson77

Basically, you need to organize the page scraping/testing logic in src/pages and it maps to the URL structure (can also use wildcards "*")

If you want to write some test page scraping logic, I suggest that you match the function signature of the GitHub scraper controller (it's the latest page logic I have been working on)

The scraper automatically exposes Puppeteer.Browser and Puppeteer.Page which will allow you to do everything you need to manipulate the page with puppeteer.

0x4007 avatar Oct 10 '22 06:10 0x4007

hi sorry for the late response, so am basically just organizing the test logic or?

pwilson77 avatar Oct 24 '22 11:10 pwilson77

I'm going to try and merge the kernel with the initial tests so I'm taking this bounty from the pool.

0x4007 avatar Oct 24 '22 18:10 0x4007

Is this issue open?

kgelpes avatar Jan 17 '23 23:01 kgelpes

Is this issue open?

@kgelpes This issue is already assigned, so not available to the bounty hunters

sergfeldman avatar Jan 18 '23 10:01 sergfeldman

@kgelpes This issue is already assigned, so not available to the bounty hunters

Technically this is correct, but I would be open to letting @kgelpes try this but we would probably need to redefine it a little bit.

The vision is to set up Puppeteer on GitHub Actions to automatically run on CI. I think that could be broken into separate bounties:

  1. Build Puppeteer code to crawl the UI. + tag a target on the components for the Puppeteer code to click and test. i.e. [data-puppeteer="click"]
  2. Puppeteer code should be ported to GItHub Actions to be invoked automatically as part of CI.

@kgelpes are you familiar with Puppeteer? If so, I could make 1. into a new bounty.

0x4007 avatar Jan 18 '23 11:01 0x4007

@kgelpes This issue is already assigned, so not available to the bounty hunters

Technically this is correct, but I would be open to letting @kgelpes try this but we would probably need to redefine it a little bit.

The vision is to set up Puppeteer on GitHub Actions to automatically run on CI. I think that could be broken into separate bounties:

  1. Build Puppeteer code to crawl the UI. + tag a target on the components for the Puppeteer code to click and test. i.e. [data-puppeteer="click"]
  2. Puppeteer code should be ported to GItHub Actions to be invoked automatically as part of CI.

@kgelpes are you familiar with Puppeteer? If so, I could make 1. into a new bounty.

I can create tests for puppeteer to test simple stuff like clicking buttons, also taking screenshots so that we can check there's no visual anomalies on builds

kgelpes avatar Jan 24 '23 02:01 kgelpes

Hello @pavlovcik, would you like to consider using playwright instead of puppeteer for UI testing in this case? I think it could be a nice fit for this project as playwright has an easy and clean way to writing tests and integrates gracefully with GitHub CI, more info:

olich97 avatar Jun 01 '23 16:06 olich97

Available commands

- /assign: Assign the origin sender to the issue automatically.
- /unassign: Unassign the origin sender from the issue automatically.
- /help: List all available commands.
- /payout: Disable automatic payment for the issue.
- /multiplier: Set bounty multiplier (for treasury)
- /allow: Set access control. (Admin Only)
- /wallet: <WALLET_ADDRESS | ENS_NAME>: Register the hunter's wallet address. 
  ex1: /wallet 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 
  ex2: /wallet vitalik.eth

@olich97

ubiquibot[bot] avatar Jun 01 '23 16:06 ubiquibot[bot]

Available commands

- /assign: Assign the origin sender to the issue automatically.
- /unassign: Unassign the origin sender from the issue automatically.
- /help: List all available commands.
- /payout: Disable automatic payment for the issue.
- /multiplier: Set bounty multiplier (for treasury)
- /allow: Set access control. (Admin Only)
- /wallet: <WALLET_ADDRESS | ENS_NAME>: Register the hunter's wallet address. 
  ex1: /wallet 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 
  ex2: /wallet vitalik.eth

@olich97

ubiquibot[bot] avatar Jun 01 '23 16:06 ubiquibot[bot]

Available commands

- /assign: Assign the origin sender to the issue automatically.
- /unassign: Unassign the origin sender from the issue automatically.
- /help: List all available commands.
- /payout: Disable automatic payment for the issue.
- /multiplier: Set bounty multiplier (for treasury)
- /allow: Set access control. (Admin Only)
- /wallet: <WALLET_ADDRESS | ENS_NAME>: Register the hunter's wallet address. 
  ex1: /wallet 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 
  ex2: /wallet vitalik.eth

@olich97

ubiquibot[bot] avatar Jun 01 '23 16:06 ubiquibot[bot]

No because we have existing infrastructure with puppeteer. Check @ubiquity/scraper-kernel. The reason why puppeteer was chosen is because it is developed and supported by the chrome team.

0x4007 avatar Jun 01 '23 17:06 0x4007

Understood, many thanks for the clarification 👍

olich97 avatar Jun 01 '23 17:06 olich97

Hello @pavlovcik , I would like to work on this. Do you think that we can schedule a call or to chat somewhere out of github?

PhantomCracker avatar Jun 19 '23 18:06 PhantomCracker

/start

molecula451 avatar Jun 19 '23 22:06 molecula451

Skipping /start since no time labels are set to calculate the timeline

ubiquibot[bot] avatar Jun 19 '23 22:06 ubiquibot[bot]

i can tackle this one after #685 closes

molecula451 avatar Jun 19 '23 23:06 molecula451

This task is not ready because we first need to update UI to follow the diamond contracts deploy

rndquu avatar Jun 20 '23 12:06 rndquu

This task is not ready because we first need to update UI to follow the diamond contracts deploy

let's work on it together

molecula451 avatar Jun 20 '23 14:06 molecula451

This task is not ready because we first need to update UI to follow the diamond contracts deploy

@rndquu is there an update on this?

0x4007 avatar Aug 09 '23 23:08 0x4007

This task is not ready because we first need to update UI to follow the diamond contracts deploy

@rndquu is there an update on this?

@molecula451 will you handle this one https://github.com/ubiquity/ubiquity-dollar/issues/731 ? If not then I'll take it

rndquu avatar Aug 11 '23 07:08 rndquu

This task is not ready because we first need to update UI to follow the diamond contracts deploy

@rndquu is there an update on this?

@molecula451 will you handle this one #731 ? If not then I'll take it

Yes I will handle the UI at #731 asap. I would have tell you otherwise

molecula451 avatar Aug 11 '23 07:08 molecula451

  • #731 appears to be completed!

0x4007 avatar Aug 29 '23 08:08 0x4007

The UI is still broken so the current issue is still blocked

I will add new UI related tasks today

rndquu avatar Aug 29 '23 08:08 rndquu

Unfortunately the #731 was mislead, because the specs mention to add a hook, keep the hook, or fix it, in any case, this was never the case, the contracts are being fetching in another way, but this was all part of the debug. We would have never known the bad state of this hook without working up through all those opened (now closed) issues.

molecula451 avatar Aug 29 '23 08:08 molecula451