ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
102 stars 43 forks source link

Create a chrome extension to export to wdi5 #317

Closed marianfoo closed 2 years ago

marianfoo commented 2 years ago

Idea

It is possible to record test cases record, playback and measure user flows in Chrome These cases can already be exported as pupeteer script by default. Since Chrome version 104 it is also possible to write an own extension for the export.

First PoC

The possibilities here are still limited, but I have already written a small example extension as an example: https://github.com/marianfoo/wdi5-chrome-recorder-extension

image

First Result from PoC

describe("ui5 query filter", () => {
  it("filter from url query hash", async () => {
    await browser.goTo({
      sHash: "https://example.com/#this-could-be-anything",
    });
    const element1 = await $("body > div > p:nth-child(3) > a");
    element1.press();
    await browser.goTo({ sHash: "https://bestofui5.org/" });
    const element2 = await $("#__component0---rootView--multiInput-inner");
    element2.press();
  });
});

Chrome API

This requires Chrome 104 (currently 103).
I tried working with the recording object (see Puppeteer's recording schema.).

It´s maybe better to work with the step object https://developer.chrome.com/docs/extensions/reference/devtools_recorder/#type-RecorderExtensionPlugin

Puppeteer's step schema.

marianfoo commented 2 years ago

Meanwhile webdriverio released their extension to export a recorded test: https://chrome.google.com/webstore/detail/webdriverio-chrome-record/pllimkccefnbmghgcikpjkmmcadeddfn?hl=en&authuser=1

vobu commented 2 years ago

yeah, saw that. thanks for putting it on the plate here! @nicogeburek + @martenAdrian - do you think it would be a better fitting base for a wdi5 recorder than https://github.com/msg-systems/ui5-testrecorder/?

martenAdrian commented 2 years ago

hi, @vobu

currently i'm not able to give you a correct answer to this. I'm currently rewrite the ui5-testrecorder, because of the V3 manifest changes of Chrome. Also i think there are different targets i want to achieve with the ui5-testrecorder. So therefore i think it depends on your view which project delivers better benefits for wdi5 ;)

vobu commented 2 years ago

hey @martenAdrian - I'd really like and go with the ui5-testrecorder, as it's a true UI5 community project. Let's talk together w/ @nicogeburek how we from the wdi5-scope can get our selectors in :)

github-actions[bot] commented 2 years ago

hey 👋 - silence for 30 days 🤐 ... anybody? 😀

vobu commented 2 years ago

this is in the works pssst, no spoilerz 🤫 ps: watch out for Devtoberfest, Oct 18th: https://groups.community.sap.com/t5/devtoberfest/testing-ui5-apps-with-wdi5-zero-to-hero-to-continuous/ec-p/8833#M2