Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jon Perl
    @jperl
    The way I think about e2e test coverage is in terms of user stories
    ZlydeTJ
    @ZlydeTJ
    Oh that looks promising, I might check it out and report my findings. I want to include the code coverage for the server too (since these are e2e tests after all), but I guess that will be Step 2 for me.
    10 replies

    Another Questions that popped up: Is there any way to mock out external url calls in playwright?

    We do this for the Server already whenever we hit an external api, but i'm thinking of doing this for playwright too. We currently have problems with images hosted on YouTube Servers which seem to be rate limited.

    If I execute tests in our test environment with the same image too often, the image won't show up. This fails if the tests are executed one after another too fast, since the images are missing.

    The easiest way would record this "external" calls and store the response, so that when replaying the tests the images would show up.

    Jon Perl
    @jperl
    6 replies
    You could match all image requests from youtube
    ZlydeTJ
    @ZlydeTJ
    This sounds like a good idea. I will test if we can write out the results to disk and load it back again with this: https://playwright.dev/#version=v1.3.0&path=docs%2Fnetwork.md&q=handle-requests
    If it doesn't work that well I simply will abort the requests.
    Weyert de Boer
    @weyert
    hello :)
    I was wondering if playwright-video+`@ffmpeg/instller` package should just work out of the box with the playwright docker image?
    Laura Cressman
    @flaurida
    @weyert yes, you should be set!
    Weyert de Boer
    @weyert
    all working
    franmoka
    @franmoka
    Hi! someone knows how see the compilate html that the browser shows. This is my case:
    I have this url view-source:http://boligmesse.mkstg.com/nb/messe/boligmesse-haugesund-2020/tickets-qr-preload/moka/?email=nico@moka.tv when its compiled JS complete the src of two <img> #image_target and #image_qr if you navigate http://boligmesse.mkstg.com/nb/messe/boligmesse-haugesund-2020/tickets-qr-preload/moka/?email=nico@moka.tv you can see what I talk about....
    My code:
    test("ticketsGeneration", async () => {
    const messagesResult = [];
    let errCount = 0;
    try {
    await page.goto(process.env.QAW_URL);
    const imageUrl = await page.$eval('//img[@id="image_ticket"]', img => img.src);
    //console.log(imageUrl);
    //const pepe = await page.goto(imageUrl);
    messagesResult.push({msg:"Success", status: "Success", err: "Nop"});
    } catch (error) {
    messagesResult.push({ msg:"Test Fail", status:"Error", err: error.message });
    errCount++;
    }
    fs.writeFile('logs/ticketsGeneration.json', JSON.stringify(messagesResult, null, 2), function (err) {
    if (err) throw err;
    });
    expect(errCount).toEqual(0);
    });
    Jon Perl
    @jperl
    Hi @franmoka can you please explain more what your question is?
    franmoka
    @franmoka
    Hi Jon, I need to reach the src of an <img> but this src is filled by a JS script.
    This is the script:
    jQuery(document).ready(function(){
    $.get( 'http://boligmesse.mkstg.com/nb/messe/boligmesse-haugesund-2020/tickets-qr/moka/?email=nico@moka.tv', function( data ) {
    var info = JSON.parse(data);
    jQuery('#image_ticket').attr('src',info.image);
    var typeNumber = 0;
    var errorCorrectionLevel = 'M';
    var qr = qrcode(typeNumber, errorCorrectionLevel);
                    if('0' == '1'){
                        qr.addData('This is a demo==================');
                    }else{
                        qr.addData(info.text_qr);
                    }
                    qr.make();
                    document.getElementById('image_qr').src = qr.createDataURL(10,0);
                    jQuery("#loader").hide();
                    jQuery("#ticketImage").show();
                    jQuery('#image_qr').show();
                });                
            });
    franmoka
    @franmoka
    If my english is too bad tell me please and re write my phrases
    Jon Perl
    @jperl
    You can use something like page.waitForFunction to wait for something that is not ready yet https://playwright.dev/#version=v1.3.0&path=docs%2Fapi.md&q=pagewaitforfunctionpagefunction-arg-options
    await page.waitForFunction(() => {
      const element = document.querySelector("image_qr");
      return element && element.src;
    });
    8 replies
    Vesnushki
    @Vesnushki
    Hello, guys! Could somebody help me with the issue? I used in the old version of qawolf this assertion
    await expect(page).toHaveText('.page-title','My Account'); But in the new version, it doesn't work. What is the analog in the new one?
    ZlydeTJ
    @ZlydeTJ

    @Vesnushki Hi, I haven't used the assertions yet, but the documentation says to use qawolf.assertElementText

    const qawolf = require('qawolf');
    // ...
    qawolf.assertElementText(page, '#container', 'hello');

    https://docs.qawolf.com/docs/api/qawolf/assert_element_text#examples

    1 reply
    Vesnushki
    @Vesnushki
    Also, Do somebody knows if qawolf has the ability to run specific test from test suit?
    I use command for run npx qawolf test, and all tests are running in this way. But I need to run only one in this suit.
    13 replies
    ZlydeTJ
    @ZlydeTJ
    @flaurida Should we expand the documentation for running single tests with some parts of the jest documentation? Since QAWolf uses Jest out-of-the-box some of the standard jest question could be answered right there.
    2 replies
    ZlydeTJ
    @ZlydeTJ

    @jperl Kinda had an idea right now: I usually run tests multiple times after creation to check for flakyness.

    It's a bit bothersome to run the command 3 times, is there a good way to rerun tests in Jest without invoking it via the cli?

    I didn't find anything for Jest, however with a little bash magic it should work: https://serverfault.com/a/273241

    Not sure if that's the best way though.

    Jon Perl
    @jperl
    Bash is probably the best option right now
    Anatolii Aboian
    @anatoliy.aboyan_gitlab
    Hi guys, maybe a noob question, but is it possible to disable Print Window popup? Its probably more questions to playwright, but maybe someone knows the recipe :)
    2 replies
    Aurélien Lair
    @aurelienlair

    Hi guys I just installed QA wolf and I have this message

    npx jest --config="node_modules/qawolf/js-jest.config.json" --rootDir=.qawolf --testTimeout=60000 myTest
    
     FAIL  .qawolf/myTest.test.js
      ● Test suite failed to run
    
        TypeError: Cannot read property 'close' of undefined
    
          13 | afterAll(async () => {
          14 |   await qawolf.stopVideos();
        > 15 |   await browser.close();
             |                 ^
          16 | });
          17 | 
          18 | test("myTest", async () => {
    
          at Object.<anonymous> (myTest.test.js:15:17)
    
    Test Suites: 1 failed, 1 total
    Tests:       0 total
    Snapshots:   0 total
    Time:        1.185 s

    The test is the one of the tutorial

    const qawolf = require("qawolf");
    
    let browser;
    let page;
    
    beforeAll(async () => {
      browser = await qawolf.launch();
      const context = await browser.newContext();
      await qawolf.register(context);
      page = await context.newPage();
    });
    
    afterAll(async () => {
      await qawolf.stopVideos();
      await browser.close();
    });
    
    test("myTest", async () => {
      await page.goto("http://todomvc.com/examples/react");
      await qawolf.create();
    });

    Any clue?

    16 replies
    Peter Trizuliak
    @trizoza_gitlab
    Screenshot 2020-09-07 at 21.20.16.png
    9 replies
    @jperl thanks, I have ran it with the DEBUG=pw:api and these are the following logs
    Peter Trizuliak
    @trizoza_gitlab
    Screenshot 2020-09-08 at 20.00.15.png
    Screenshot 2020-09-08 at 20.00.27.png
    Erica Garcete
    @PinkWhale_gitlab
    Greetings
    Laura Cressman
    @flaurida
    greetings @PinkWhale_gitlab :wave: like your profile pic!
    Erica Garcete
    @PinkWhale_gitlab
    @flaurida Thank you!
    Erica Garcete
    @PinkWhale_gitlab
    I just found this tool two days ago and have been using It those days. Just asking, Can I contribute for the Spanish version of the website/tutorial?
    Laura Cressman
    @flaurida
    Hi @PinkWhale_gitlab of course! thank you :blush:
    We can let you know when we set up internationalization?
    Erica Garcete
    @PinkWhale_gitlab
    of course, I'd be glad to do it. Thank you :D @flaurida
    Laura Cressman
    @flaurida
    Thank you for offering @PinkWhale_gitlab :grinning:
    Erica Garcete
    @PinkWhale_gitlab
    Good morning! Which is the best Reporting tool for QA wolf?
    8 replies
    Vesnushki
    @Vesnushki
    Hello, guys!
    Could somebody help me with finding elements on the page?
    page.$$(selector) - can I use this expression for finding elements by css selector?
    what is the difference between page.$$(selector) and page.$(selector)?
    3 replies
    AndrewLazare443
    @AndrewLazare443
    Hi all new to QA Wolf. I know where I messed up...I dont know how to fix it though. How can i set my path back to Default?
    Laura Cressman
    @flaurida
    Hi @AndrewLazare443 check out this guide https://docs.qawolf.com/docs/configure_qa_wolf
    In short please check the qawolf.config.js file. Let us know if that solves your problem!
    Jara Quintana
    @jaraqz_twitter
    Hi!!
    Is it possibe to assign an order to test when you run all of them in --runInBand???
    Laura Cressman
    @flaurida
    Hi @jaraqz_twitter - I believe so, this is just a jest setting. This issue has a few ideas, let me know if it helps! facebook/jest#6194
    Vesnushki
    @Vesnushki
    Hello, the community! Please help me with finding the element's text ? I am new in qawolf
    Laura Cressman
    @flaurida
    25 replies
    for example: const myText = await page.innerText('#mySelector')
    let me know if that helps!
    Jon Perl
    @jperl
    /all qawolf@1.4.0 is now released. Lots of improvements:
    • Upgrade playwright to 1.4.1
    • Pressing reload now creates page.reload()
    • Pressing back now creates page.goBack()
    • Opening a new tab creates context.newPage()
    • Entering a url into the address bar creates page.goto(url)
    • When switching between multiple pages, page.bringToFront is called
    • Improved selectors for dynamic attributes
    • Improved selectors to consider other targets