0

I am using Protractor for writing e2e test cases in Angular using Jasmin.

I am using Saucelab for executing my test cases on Chrome, Firefox, Edge and IE11.

I came across a issue that hover functionality using mouseMove doesen't work in case of IE11 so i want to skip those test-cases for IE11 but thost test must execute for rest 3 browsers.

My protractor.config.js file as below ... ...

     multiCapabilities: ([
        {
           name: "ds-e2e-firefox",
           browserName: "firefox",
           version: "63"
        },
        {
           name: "ds-e2e-chrome",
           browserName: "googlechrome",
           version: "70"
        },
        {
           name: "ds-e2e-edge",
           browserName: "MicrosoftEdge",
           version: "16",
           avoidProxy: true
        },
        {
          name: "ds-e2e-ie11",
          browserName: "internet explorer",
          version: "11",
          iedriverVersion: "3.12.0"
        }
      ]).map(cap => Object.assign(cap, {
        platform: "Windows 10",
        seleniumVersion: SELENIUM_VERSION,
        screenResolution: "1920x1080"
      }))
    };
...

I am open with some other workaround as i am unable to think how to achieve this.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Shashank.gupta40
  • 915
  • 1
  • 8
  • 26

2 Answers2

0

multicapabilities is collection which takes array of capability so you Can try with exclude keyword reserved for ignoring spec files.

    {
      name: "ds-e2e-ie11",
      browserName: "internet explorer",
      version: "11",
      iedriverVersion: "3.12.0",
      exclude: [specfile.js, specfile2.js]
    }
Nitin Sahu
  • 611
  • 6
  • 12
0

One of the ways to approach it is this way

it("Search by name", async () => {

    // open home page
    await browser.get(params.baseUrl);

    let capabilities = await browser.getCapabilities();
    let browserName = capabilities.map_.get('browserName');

    if (browserName === "chrome") {
        // your test goes here
    }
});
Sergey Pleshakov
  • 7,964
  • 2
  • 17
  • 40