Giter VIP home page Giter VIP logo

Comments (18)

murcraft avatar murcraft commented on September 27, 2024

I have a project with the next parameters:
Node Version v8.9.4 (NPM: 5.6.0)
Operating System: Windows 10

[email protected]
[email protected]

My protractor-flake.file:
_let protractorFlake = require('protractor-flake')
let protractorArgs = []
process.env.maxAttempts = 2

protractorArgs.push('conf.js')
let suiteArg = "--suite=${process.env.suite}"

protractorFlake({
maxAttempts: process.env.maxAttempts,
parser: 'standard',
nodeBin: 'node',
color: 'magenta',
protractorArgs: protractorArgs
}, function (status) {
process.exit(status)
})_

conf.js file for protractor:

const AllureReporter = require('jasmine-allure-reporter')

exports.config = {
allScriptsTimeout: 11000,
SELENIUM_PROMISE_MANAGER: false,
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 240000,
},
params: {
waitTimeout: 60000,
},
specs: [
'lib/spec/suite1/*.js',
],
suites: {
all: 'lib/spec/suite1/test.js',
},

baseUrl: process.env.env = 'http://www.google.by',

capabilities: {
browserName: 'chrome',
shardTestFiles: process.env.maxinstances > 1,
maxInstances: process.env.maxinstances,
chromeOptions: {
args: [
'incognito',
// 'headless',
// 'disable-gpu',
'window-size=1920,1080',
'--disable-infobars',
'--disable-extensions',
'--ignore-ssl-errors=true',
'verbose',
'--disable-web-security'
],
},
prefs: {
download: {
prompt_for_download: false,
directory_upgrade: true,
},
},
loggingPrefs: {
'browser': 'SEVERE',
},
},

onPrepare: async () => {
browser.waitForAngularEnabled(false)
global.EC = protractor.ExpectedConditions
global.Logger = require('./lib/helpers/logger')

jasmine.getEnv().addReporter(new AllureReporter({
resultDir: 'allure-results',
}))

jasmine.getEnv().addReporter(new function () {
  this.jasmineStarted = function (summary) {
    global.TOTAL = summary.totalSpecsDefined
    global.PASSED = 0
    global.FAILED = 0
    global.SKIPPED = 0
    Logger.info(
      "!----------Tests started. Total tests: ${TOTAL}----------!")
  }
  this.suiteStarted = function (result) {
    Logger.info("--------------------------------------------------")
    Logger.info("Suite starts: ${result.fullName}")
    Logger.info("--------------------------------------------------")
  }
  this.specStarted = function (result) {
    Logger.info("Spec starts: ${result.description}")
  }
  this.specDone = function (result) {
    if (result.status === 'passed') {
      PASSED++
    }
    if (result.status === 'disabled' || result.status === 'pending') {
      SKIPPED++
    }
  }
 this.jasmineDone = function () {
    Logger.info("**************************************************")
    Logger.info("${PASSED + FAILED + SKIPPED} of ${TOTAL} tests done")
    Logger.info("Passed: ${PASSED}")
    Logger.info("Failed: ${FAILED}")
    Logger.info("Skipped: ${SKIPPED}")
    Logger.info("**************************************************")
  }
})

jasmine.getEnv().afterEach(async function () {
  await Logger.LogConsoleErrors()
  try {
    await browser.takeScreenshot().then(function (png) {
      allure.createAttachment('Screenshot', function () {
        return new Buffer(png, 'base64')
      }, 'image/png')()
    })
  } catch (e) {
    Logger.error("Screen shot was not taken\n${e}")
  }
})
await browser.get('')

}
}

from protractor-flake.

andreybruslik avatar andreybruslik commented on September 27, 2024

We faced the same problem:

Node Version v10.13.0 (NPM: 6.4.1)
Operating System: Windows 10

protractor@5.4.2
protractor-flake@3.4.0

from protractor-flake.

jayvdb avatar jayvdb commented on September 27, 2024

It seems to be related to something in the v3.4.0 release. v3.3.0 was working well.

from protractor-flake.

jayvdb avatar jayvdb commented on September 27, 2024

#98 seems like the cause.

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

Thanks for finding this. I'll figure out a revert strategy and roll this back in the next few hours for a short term fix, we can then figure a way to incorporate the new functionality with #98 in way that doesn't break things.

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

I've just released v3.4.1 which removes the feature added in #98. Can someone confirm that this has resolved the issue?

from protractor-flake.

murcraft avatar murcraft commented on September 27, 2024

Unfortunatelly, it's still not worked
"protractor": "^5.4.2",
"protractor-flake": "^3.4.1"

screen

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

I think the current workaround is to pin to v3.3.0 I think this is actually broken by the typescript upgrade (that happened between 3.3.0 and 3.4.0 and not the changes in #98. I don't have time to investigate until later today but I'll happily accept a PR in the meantime.

from protractor-flake.

murcraft avatar murcraft commented on September 27, 2024

I'm looking forward solving of this problem, thanks!

p.s. I noticed it works only I set "protractor-flake": "3.3.0" certain version, without ^

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

It looks like this was due to some logic in logger.ts that did not get moved over in the switch to JS (my fault!). I have a fix that you should be able to use locally by installing from the branch:

npm i protractor-flake@NickTomlin/protractor-flake#fix-102

@murcraft @jayvdb could one of you test that to verify? If so I can release a new version with that fix in place and re-roll the changes in #98

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

I'm also unpublishing 3.4.0 and 3.4.1 for the time being to prevent others from opting into this breakage with semantic versioning.

from protractor-flake.

murcraft avatar murcraft commented on September 27, 2024

Yes, it works!

from protractor-flake.

andreybruslik avatar andreybruslik commented on September 27, 2024

It works! Thanks.

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

@murcraft @andreybruslik

Just to confirm, are you saying that the branch in npm i protractor-flake@NickTomlin/protractor-flake#fix-102 you works locally?

from protractor-flake.

perchwell-e2e avatar perchwell-e2e commented on September 27, 2024

@murcraft @andreybruslik

Just to confirm, are you saying that the branch in npm i protractor-flake@NickTomlin/protractor-flake#fix-102 you works locally?

Yes, my project works with using this branch

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

@perchwell-e2e Great thanks for confirming that!

I'll try to prep a new release this weekend to restore the changes in #98. It looks like there's still some integration test breakage that I need to sort out before that happens.

from protractor-flake.

andreybruslik avatar andreybruslik commented on September 27, 2024

@murcraft @andreybruslik

Just to confirm, are you saying that the branch in npm i protractor-flake@NickTomlin/protractor-flake#fix-102 you works locally?

I'm working with public repo. And now initial issue is not reproducible for me.

from protractor-flake.

NickTomlin avatar NickTomlin commented on September 27, 2024

I'm going to go ahead and close this. I'll follow up with re-enabling #98 in the next few weeks when I have time.

from protractor-flake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.