Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not fully e2e tested #51

Closed
yakalinkin opened this issue Feb 26, 2018 · 7 comments
Closed

Not fully e2e tested #51

yakalinkin opened this issue Feb 26, 2018 · 7 comments

Comments

@yakalinkin
Copy link

yakalinkin commented Feb 26, 2018

Pass/Fail counts reported as 24 - should be 30

Example code

/* protractor.conf.js */

multiCapabilities: [
  {
    browserName: 'chrome',
    count: 5
  },
  {
    browserName: 'firefox',
    count: 5
  }
]
Specs: 3

The runner process is reported as "24" and not "30" as it should. How to fix it?

I get an error

I/runnerCli - ENOENT: no such file or directory, stat 'C:\**\dist\report\assets\bootstrap.css'
E/launcher - Runner process exited unexpectedly with error code: 1

System

protractor-beautiful-reporter: 1.2.0
protractor: 5.3.0
standalone: 3.9.1
platform: win10
@Evilweed
Copy link
Owner

@yakalinkin can You attach full protractor.conf.js and spec file that reproduces this issue?

@yakalinkin
Copy link
Author

/* protractor.conf.ts */

import { Config } from 'protractor';

const JasmineConsoleReporter = require('jasmine-console-reporter');
const HtmlReporter = require('protractor-beautiful-reporter');

export let config: Config = {
  SELENIUM_PROMISE_MANAGER: false,

  framework: 'jasmine',

  jasmineNodeOpts: {
    showColors: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 900000,
  },

  seleniumAddress: 'http://localhost:4444/wd/hub',

  specs: ['./googleExample.spec.js'],

  multiCapabilities: [
    {
      browserName: 'chrome',
      count: 5
    },
    {
      browserName: 'firefox',
      count: 5
    },
  ],

  getPageTimeout: 600000,
  allScriptsTimeout: 600000,

  onPrepare() {
    setupReporter();
  },
};

export function setupReporter() {
  jasmine.getEnv().clearReporters();

  jasmine.getEnv().addReporter(new JasmineConsoleReporter({
    colors: true,
    cleanStack: true,
    verbosity: true,
    listStyle: 'flat', // "flat"|"indent"
    activity: false,
  }));

  jasmine.getEnv().addReporter(new HtmlReporter({
    baseDirectory: 'dist/report',
    screenshotsSubfolder: 'images',
    jsonsSubfolder: 'jsons',
    gatherBrowserLogs: false,
    preserveDirectory: false,
  }).getJasmine2Reporter());
}
/* googleExample.spec.ts */

import { $, browser, protractor } from 'protractor';

browser.waitForAngularEnabled(false);

describe('Google', () => {
  beforeAll(async () => {
    await browser.get('http://google.com/');
  });

  it('should search by `protractor`', async () => {
    await $('.gsfi[name="q"]').sendKeys('protractor', protractor.Key.RETURN);

    const value = await $('.gsfi[name="q"]').getAttribute('value');
    expect(value).toEqual('protractor');
  });
});

Pass/Fail counts reported as 7 - should be 10

Errors

[firefox #61] I/runnerCli - EBUSY: resource busy or locked, rmdir 'C:\**\dist\report\images'
[firefox #61] E/launcher - Runner process exited unexpectedly with error code: 1
[firefox #71] I/runnerCli - ENOTEMPTY: directory not empty, rmdir 'C:\**\dist\report\jsons'
[firefox #71] E/launcher - Runner process exited unexpectedly with error code: 1
[firefox #51] ENOENT: no such file or directory, open 'C:\**\dist\report\assets\angular.min.js'
[firefox #51]     at Object.fs.openSync (fs.js:663:18)
[firefox #51]     at copyFileSync (C:\**\node_modules\protractor-beautiful-reporter\index.js:10731:18)
[firefox #51]     at copySync (C:\**\node_modules\protractor-beautiful-reporter\index.js:10799:5)
[firefox #51]     at contents.forEach.content (C:\**\node_modules\protractor-beautiful-reporter\index.js:10810:7)
[firefox #51]     at Array.forEach (<anonymous>)
[firefox #51]     at Object.copySync (C:\**\node_modules\protractor-beautiful-reporter\index.js:10807:14)
[firefox #51]     at addHTMLReport (C:\**\node_modules\protractor-beautiful-reporter\index.js:5119:17)
[firefox #51]     at Object.addMetaData (C:\**\node_modules\protractor-beautiful-reporter\index.js:5193:9)
[firefox #51]     at Jasmine2Reporter._callee8$ (C:\**\node_modules\protractor-beautiful-reporter\index.js:4962:38)
[firefox #51]     at tryCatch (C:\**\node_modules\protractor-beautiful-reporter\index.js:5377:40)

[firefox #51] ENOENT: no such file or directory, rmdir 'C:\**\dist\report\.lock'
[firefox #51]     at Object.fs.rmdirSync (fs.js:866:18)
[firefox #51]     at Object.addMetaData (C:\**\node_modules\protractor-beautiful-reporter\index.js:5195:12)
[firefox #51]     at Jasmine2Reporter._callee8$ (C:\**\node_modules\protractor-beautiful-reporter\index.js:4962:38)
[firefox #51]     at tryCatch (C:\**\node_modules\protractor-beautiful-reporter\index.js:5377:40)
[firefox #51]     at Generator.invoke [as _invoke] (C:\**\node_modules\protractor-beautiful-reporter\index.js:5651:22)
[firefox #51]     at Generator.prototype.(anonymous function) [as next] (C:\**\node_modules\protractor-beautiful-reporter\index.js:5410:21)
[firefox #51]     at step (C:\**\node_modules\protractor-beautiful-reporter\index.js:4481:191)
[firefox #51]     at C:\**\node_modules\protractor-beautiful-reporter\index.js:4481:361
[firefox #51]     at <anonymous>
[firefox #51]     at process._tickCallback (internal/process/next_tick.js:160:7)

@Evilweed
Copy link
Owner

@yakalinkin I've tried to reproduce Your case on OSx - sadly it works properly. I don't have windows machine to test it on Windows system :(

Can You check if this issue occurs if You set preserveDirectory: true ?

@yakalinkin
Copy link
Author

yakalinkin commented Feb 28, 2018

@Evilweed preserveDirectory: true doesn't work well always.
They lose results if WebDriverError: java.net.BindException: Address already in use: connect error.

The reporter also breaks down on the OS X.

@Evilweed
Copy link
Owner

@yakalinkin I tried Your config and test case again on OSx (multiple times) and it keeps showing me proper 10/10 test cases reported. Does this issue occur constantly or just sometimes?

@yakalinkin
Copy link
Author

@Evilweed Now, works fine. I don't know what's happened.

I think you can close this issue now :)

@Evilweed
Copy link
Owner

Evilweed commented Mar 6, 2018

@yakalinkin closing as per comment. Thanks :)

@Evilweed Evilweed closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants