mercredi 25 novembre 2020

Trigger the Protractor test programmatically

I am developing an application (angular7 and spring boot), which is web testing tool. e.g. We need to create the Test script using the UI. Then, we can execute this script by just clicking on execute button with different technologies e.g. selenium, OATS, Protractor.

In this application I want to integrate the Protractor. I have created a config.js and spec.js file. So, Issue I am facing are:

  1. I need to trigger the execution programmatically.
  2. Pass the parameter to the spec.js file

Solution I have tried:

  1. I have created a new angular project. In which I have added config.js and spec.js. and tried running that from app.component.ts using following code.
const Launcher = require("protractor/built/launcher");
Launcher.init('path/to/conf');

But its not working. error is :

Module parse failed: Unexpected character '#' (1:0)

Can you suggest me any way?

Aucun commentaire:

Enregistrer un commentaire