Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 19:00
    tfaron commented #5133
  • Jan 31 2019 07:28
    cnishina closed #5135
  • Jan 31 2019 07:28
    cnishina commented #5135
  • Jan 30 2019 16:23
    ThabisoGithub closed #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:21
    ThabisoGithub opened #5136
  • Jan 30 2019 16:18
    IgorSasovets commented #4177
  • Jan 30 2019 15:05
    andrewchan-clover commented #4177
  • Jan 30 2019 13:43
    IgorSasovets commented #5135
  • Jan 30 2019 12:37
    EnzDev edited #5125
  • Jan 30 2019 11:47
    akshaymondal opened #5135
  • Jan 29 2019 14:33
    uinest commented #4822
  • Jan 28 2019 21:38
    cnishina commented #5132
  • Jan 28 2019 21:37
    cnishina commented #5134
  • Jan 28 2019 21:37
    cnishina closed #5134
  • Jan 28 2019 21:36

    cnishina on selenium4

    chore(release): bumpb version t… (compare)

  • Jan 28 2019 11:30
    think4ideas opened #5134
  • Jan 28 2019 11:01
    toniedzwiedz commented #2735
  • Jan 28 2019 09:42
    azorrozua commented #4786
Gėorges
@gmoussayan
This might help too: elgalu/docker-selenium#20
ninogomez
@ninogomez
Hey guys. Got a question. When I tried to run my tests headless I seem to be getting logs in the console.
[0626/205925.925:INFO:CONSOLE(45943)] these appears everywhere. Any reason why and how to hide this? Thanks!
Gėorges
@gmoussayan

Hello guys, I was making a little protractor demo and the dev lead suggested to update the application html code to include a fixed 'attribute:value' pairs on all fields, so my test remains valid in case any change took place on any class, buttons names, etc...

so based on the above, i then, in my tests, I will be calling all elements on the application using the css locator (so all my tests will be written using by.css) in this way: element(by.css("tagname[attribute='value']")

the reason for this suggested change is to make our automated test stable, and not affected by any code changes...so im wondering if this is an acceptable practice? (I know that it will make my life much easier as an automation tester, but at the same time i'm finding it weird and i'm wondering if there are any disadvantages that im not yet aware of?) - let me know what you think
((Im thinking that such a change would put the app security at risk too, no?))

ninogomez
@ninogomez
@gmoussayan Nice! That's correct. It's good practice. Rather than dealing with changing xpaths, it's advisable to get it by class, name, etc, in your case attributeName=value. Couldn't think of any disadvantage of it. However though, make sure that it's unique.
Gėorges
@gmoussayan
Yep, it will be unique, thanks @ninogomez
Ahmed Elshaikh
@elshaikh2_twitter
Hii All, I am facing an issue while run protractor test for 1st time, so i need your help plz as i am new in protractor
the error that i got shown in the image , and plz look into conf, package.json & spec.js
![alt]https://1drv.ms/u/s!AqB-Fj4rjhcpv03pr484fpVIFRNZ
[16:38:15] E/configParser - Error code: 105
[16:38:15] E/configParser - Error message: configuration file conf.js did not export a config object
[16:38:15] E/configParser - Error: configuration file conf.js did not export a config object
    at ConfigParser.addFileConfig (/usr/local/lib/node_modules/protractor/built/configParser.js:141:19)
    at Object.initFn [as init] (/usr/local/lib/node_modules/protractor/built/launcher.js:93:22)
    at Object.<anonymous> (/usr/local/lib/node_modules/protractor/built/cli.js:226:10)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
Gėorges
@gmoussayan
Hello guys! any recommended good protractor tutorial?
ArtemRudenko
@artemrudenko
@gmoussayan hi, what your dev lead suggested is a good practice (to use or not to use it always depends on a dev team - here i mean that if they are ready and want to update all the components to have a unique id/attr this is really cool).
@gmoussayan about protractor tutorial - for me the default http://www.protractortest.org/#/toc is probably one of the best
Gėorges
@gmoussayan
I see. Thanks for the info @artemrudenko
ArtemRudenko
@artemrudenko
@gmoussayan you are welcome
We use Azure Devops, where you have a separate build and release stage
we would like to package the Protractor tests as another artifact in the buil stage
and then use this package in the release pipeline to run e2e tests against the deployed location
if the tests succeed the application is automatically deployed to the next environment
unfortunately we are not able to create an environment ad hoc to run the tests for every build
so we would like to be able to run a command like npm run build:e2e which would create an e2e/dist folder that contains a ready to go .js file that you can run with one command
ninogomez
@ninogomez
@wilgert should it be ng serve which brings up the instance/app and then run npm run e2e for tests?
Wilgert Velinga
@wilgert
No it should run the tests against a deployed version of the angular app and a deployed version of the backend. So we have true e2e tests.
but i want to do it in the release pipeline, where the input is a zipped /dist folder containing the angular app
in the release pipeline I do not want to checkout the repo again, install dependencies and run protractor
i would like to be able to create a zip containing everything needed to run protractor as a node script
we already run the protractor tests with a mock backend on every commit in the build pipeline to verify the angular app
Mayank Verma
@mayankverma24
Hi all, How can I check if the element has active in its classname?
In JavaScript, there is hasclass
Is there anything like that in typescript too?
Thimmaraju G
@thimmaraju418_twitter
Hi All ..how do i run autoit exe file is protractor script.
ArtemRudenko
@artemrudenko
@mayankverma24 you can try smth like this
    const classes = await el.getAttribute('class');
    const isActive = classes.split(' ').indexOf('active') > -1;
   // Or
   isActive = classes.includes('active');
Luke
@luker2
Any way to have protractor run the same .spec multiple times in parallel? I guess you could copy/paste the actual .spec file & have the glob pick up multiple file instances, but I'd rather not copy the file out a bunch of times
Sri Harsha
@harsha509
@lukeanderson you can use capability count:noOfInstances to achieve this.
Luke
@luker2
@Harsha509 yay! perfect!
Luke
@luker2
@Harsha509 @cnishina although I don't think jasmine is fully compatible with the count capability - like it can't tell the difference between the tests. count: 2 runs a test twice, and a jasmine reporter will output 2 specStarted's, but they have the same id :/ (so later if I wanted to associate the test's specDone or other jasmine output back to the same test, I couldn't)
{
    "id": "spec0",
    "description": "",
    "fullName": "",
    "failedExpectations": [],
    "passedExpectations": [],
    "pendingReason": ""
}, {
    "id": "spec0",
    "description": "",
    "fullName": "",
    "failedExpectations": [],
    "passedExpectations": [],
    "pendingReason": ""
}
Sri Harsha
@harsha509
@luker2 , mm very strange. But am able to get the details correctly checked just now. Here is the output from spec done

{"id":"spec0","description":"should add one and one","fullName":"Protractor Demo App should add one and one","failedExpectations":[],"passedExpectations":[{"matcherName":"toEqual","message":"Passed.","stack":"","passed":true}],"pendingReason":"","status":"passed"}

{"id":"spec1","description":"should add one and two","fullName":"Protractor Demo App should add one and two","failedExpectations":[],"passedExpectations":[{"matcherName":"toEqual","message":"Passed.","stack":"","passed":true}],"pendingReason":"","status":"passed"}
{"id":"spec2","description":"should add one and three","fullName":"Protractor Demo App should add one and three","failedExpectations":[],"passedExpectations":[{"matcherName":"toEqual","message":"Passed.","stack":"","passed":true}],"pendingReason":"","status":"passed"}
{"id":"spec3","description":"should add one and Four","fullName":"Protractor Demo App should add one and Four","failedExpectations":[],"passedExpectations":[{"matcherName":"toEqual","message":"Passed.","stack":"","passed":true}],"pendingReason":"","status":"passed"}
{"id":"spec4","description":"should add one and five","fullName":"Protractor Demo App should add one and five","failedExpectations":[],"passedExpectations":[{"matcherName":"toEqual","message":"Passed.","stack":"","passed":true}],"pendingReason":"","status":"passed"}

Luke
@luker2
@Harsha509 Is that with 1 spec/describe file and count: 5? Do you have multiple it() blocks per spec file?
Sri Harsha
@harsha509
My bad. Yes I have multiple it blocks, are you trying to do it with single it block ?
Luke
@luker2
Yep, 1 it block per describe.
Luke
@luker2
@Harsha509 This work-around may solve my issue. When running in parallel, since each describe/spec appears to be an individual node process - I can set a unique instance id as an environment variable, then reference it later in the jasmine reporter
// .spec.ts file
describe('example test', () => {

    process.env.instanceId = generateGuid();
    console.log('describe instanceId: ' + process.env.instanceId);

    it('run test steps', () => {
        // do stuff
    });
});

// jasmine reporter
export class CustomJasmineReporter implements CustomReporter {

    specStarted(data: any) {
        data.instanceId = process.env.instanceId;
        console.log(`specStarted: ${JSON.stringify(data)}`)
    }

    specDone(data: any) {
        data.instanceId = process.env.instanceId;
        console.log(`specStarted: ${JSON.stringify(data)}`)
    }
}
Sri Harsha
@harsha509
👍🏻
vnvbsudhakar
@vnvbsudhakar
Hi All,

Hi All, I am new to protractor - automation testing. I am following protractor website to do create few dummy tests.
Problem statement: i don't see line number when any test case fails
for eg:
D:\ProtractorDeltaPOC>protractor conf.js
[07:53:44] I/launcher - Running 1 instances of WebDriver
[07:53:44] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[07:53:51] I/launcher - 0 instance(s) of WebDriver still running
[07:53:51] I/launcher - chrome #01 failed 1 test(s)
[07:53:51] I/launcher - overall: 1 failed spec(s)
[07:53:51] E/launcher - Process exited with error code 1

in the above code, it says test is failed but there are no reference. Can someone help me.

Sri Harsha
@harsha509
Hi @vnvbsudhakar, Try to enable includeStackTrace:true in jasmineNodeOpts. And also can you please ping me your spec file, it should log the stack traces if the test fails basically !!!
vnvbsudhakar
@vnvbsudhakar
@Harsha509 : I shall try this and get back to you. By any chance do you know where can I do proxy settings
JJNULL
@JJNULL
@JJNULL
Good morning a question I want to make a configurator for word files and be able to export them, someone knows of some pluggin
in Angular
Sri Harsha
@harsha509

Hi @vnvbsudhakar , you can set proxy in capabilities like this

capabilities: {
'proxy': {
'proxyType': 'manual',
'httpProxy': 'hostname.com:1234'
}
}

If that does not work, try to set node proxy using npm like below
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Hope this helps!
vnvbsudhakar
@vnvbsudhakar
okay