NickTomlin / protractor-flake

Rerun potentially flakey protractor tests before failing.
MIT License
80 stars 51 forks source link

custom parser integration:Does that require build again #81

Closed poojaiiit closed 6 years ago

poojaiiit commented 7 years ago

@NickTomlin How to integrate a custom parser and add some print statements into the same to check if that is working as expected.I created the custom parser as below:

module.exports = {
  name: 'custom parser',
  parse (output) {
    let failedSpecs = []
    let match = null
    let FAILED_LINES =  /^(.*(Spec.js).*)$/g
    while (match = FAILED_LINES.exec(output)) { // eslint-disable-line no-cond-assign
      if (failedSpecs.indexOf(match[1]) === -1) {
        failedSpecs.add(match[1])
      }
    }

    return failedSpecs
  }
}

however the only change is let FAILED_LINES = /^(.*(Spec.js).*)$/g from the default custom parser in /test/unit/support

I am not sure if this is picking the changes..is there a way to add some console logging in the parser?

Running the same via following command:

protractor-flake --parser /usr/local/lib/node_modules/protractor-flake/test/unit/support/custom-parser.js  --max-attempts=3 -- conf.js 
(node:25005) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[21:23:13] I/launcher - Running 1 instances of WebDriver
[21:23:13] I/local - Starting selenium standalone server...
[21:23:13] I/local - Selenium standalone server started at http://192.168.0.101:51511/wd/hub
no params received
beta
Running on Environment::::beta
ConsoleReporter is deprecated and will be removed in a future version.
Error: Failed expectation

at /Users/poojaag/workspace_pooja/src/ShipWithAmazonUIAutomation/src/specs/CountShipmentFromDashboardSpec.js:43:40

Started
Started

problem trying to remove a folder:build/brazil-integ-tests/

No specs found
Finished in 0.004 seconds

No specs found

Finished in 0 seconds
NickTomlin commented 7 years ago

Using a custom parser does not require a rebuild.

From the output it looks like no tests are found? No specs found are you sure your specs are actually running?

NickTomlin commented 6 years ago

Going to go ahead and close this since I haven't heard back.