Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    ie qawolf.launch({ args: ['--start-fullscreen'] });
    19 replies
    maheshpatnam
    @maheshpatnam
    @jperl can you please tell me how to get colour of webelement? . I am using following code , But it is not working
    const videoIconSelector = '//span[text()=\'videocam\']';
    let videoIconColour = page.getAttribute(videoIconSelector,'color');
    console.log(videoIconColour);
    maheshpatnam
    @maheshpatnam
    @flaurida can u please help me?
    Laura Cressman
    @flaurida
    Hi @maheshpatnam are you trying to get the CSS color (as in font color), or background color?
    ie something like
    const color = await page.evaluate(() => {
      const videoIcon = document.querySelector( '//span[text()=\'videocam\']');
      const videoIconStyles = window.getComputedStyle(videoIcon);
      return videoIconStyles.getPropertyValue('color');
    });
    Note that it may look slightly different for you - color in CSS means font color, which may not be what you want. It may be background-color, fill, or stroke.
    maheshpatnam
    @maheshpatnam
    Thanks @flaurida , I will check now
    maheshpatnam
    @maheshpatnam
    page.evaluate: Evaluation failed: TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at eval (playwright_evaluation_script517:3:40)
    at UtilityScript.callFunction (playwright_evaluation_script462:305:24)
    at UtilityScript.<anonymous> (playwright_evaluation_script518:1:44) Getting this @flaurida
    Laura Cressman
    @flaurida
    @maheshpatnam OK, I see. I'd probably add a console log to see what the videoIcon is. I am happy to debug on a call with you as well if you are willing. feel free to DM me
    From the error message it looks like videoIcon is not an element, so perhaps document.querySelector is returning null here if the element is not found
    maheshpatnam
    @maheshpatnam
    @flaurida i used this code , it worked for me , Thanks
    sync function getAVtestIconColour(page) {
    const videoIconColor = await page.evaluate(() => {
    const videoIcon = document.evaluate('//span[text()=\'videocam\']/parent::div', document, null, XPathResult.ANY_TYPE, null).iterateNext();
    const videoIconStyles = window.getComputedStyle(videoIcon);
    return videoIconStyles.getPropertyValue('background-color');
    });
    Laura Cressman
    @flaurida
    @maheshpatnam great glad you figured it out! It seems like the issue was finding videoIcon in the first place
    1 reply
    maheshpatnam
    @maheshpatnam
    Hi All, Is there way to check button is enabled or disabled in playwright?, I am using following code , But It is not working
    async function isStickerButtonDisabled(page) {
    const stickerButtonStateValue = await page.evaluate(() => {
    const stickerButton = document.querySelector('button[data-heap-id="userMenuToggleSticker"]');
    const stickerButtonState = window.getComputedStyle(stickerButton);
    return stickerButtonState.getPropertyValue('disabled');
    });
    console.log('button state is' + stickerButtonStateValue);
    }
    @flaurida @jperl can you guys help me?
    maheshpatnam
    @maheshpatnam
    I used following code , It worked
    async function isStickerButtonDisabled(page) {
    const stickerButtonState = await page.evaluate(() => {
    const stickerButton = document.querySelector('button[data-heap-id="userMenuToggleSticker"]');
    return stickerButton.disabled
    });
    return stickerButtonState;
    }
    Laura Cressman
    @flaurida
    @maheshpatnam are you set then?
    maheshpatnam
    @maheshpatnam
    yes @flaurida
    1 reply
    sushmitha gayam
    @sushmithaGayam
    Hey i just started using qawolf. I have a scenario where I'm trying to generate screenshots on different browsers and using this command "npx qawolf test --all-browsers <filrname>". Is there away qawolf can tell me which browser instance its currently running the tests on?
    1 reply
    maheshpatnam
    @maheshpatnam
    Hi All,
    Is there any way to check element not present in playwright?, Currently I am using following code, But it is not working.
    async function isFloatingVideoNotPresent(page) {
    await page.mainFrame().waitForSelector(floatingVideoSelector);
    if (await page.$$(floatingVideoSelector).length === 0) {
    return true;
    }
    else {
    return false;
    }
    } @flaurida @jperl
    2 replies
    Denver Peterson
    @denver
    Trying to run some mobile browser tests and when I pass in --firefox I get an error browser.newContext: options.isMobile is not supported in Firefoxbrowser.newContext: options.isMobile is not supported in Firefox:
    4 replies
    Maybe I need to update playwright.
    Denver Peterson
    @denver
    Is there a way to modify a configuration to run the actual applications for chrome, firefox, safari on a mac instead of chromium, nightly, playwright (1.0)?
    1 reply
    Shabeer Ali M
    @shabeer_ali_m_twitter
    Hii is this helpfull to test REST API ?
    3 replies
    maheshpatnam
    @maheshpatnam
    Hi All, Is there any way to get title of newly opened page in new tab in playwright?
    3 replies
    Laura Cressman
    @flaurida
    Thanks @denver ! ^
    maheshpatnam
    @maheshpatnam
    @denver How can i open new page in already opened page?
    maheshpatnam
    @maheshpatnam
    i used following code ,It worked, Thanks @denver
    let pages = await contextAA.pages();
    await pages[1].bringToFront();
    console.log(pages[1].title());
    Laura Cressman
    @flaurida
    @maheshpatnam are you set then?
    maheshpatnam
    @maheshpatnam
    yes @flaurida
    Hi All, How to get value of input tag in playwright?
    Laura Cressman
    @flaurida
    @maheshpatnam try this
    const searchValue = await page.$eval('#myId', el => el.value);
    maheshpatnam
    @maheshpatnam
    Thanks @flaurida, I used above code, It worked for me
    Laura Cressman
    @flaurida
    @maheshpatnam great!
    Matt Bangert
    @mattbangert
    Is anyone experiencing empty videos and no logs in the artifact directories? Upon a test run, the directories are made for each test and I get a video file, but the video is blank and there are no logs. Here is my execution command QAW_ARTIFACT_PATH=/tmp/testArtifacts/ DEBUG=pw:api BASE_URL=<my_url> yarn qawolf test absoluteDaysSaveCorrectly
    4 replies
    Denver Peterson
    @denver
    When I run tests on Mac, the tests run in Chromium, Nightly (Firefox) and Playwright (webkit).
    Is there a way to change a config and point to the actual applications if I wanted to? ie. Chrome (not as important), firefox (mac) and safari?
    6 replies
    Jon Perl
    @jperl

    @/all we are “soft-launching” QA Wolf 2.0 next week. There are a ton of improvements: much better test creation experience, improved video recording, easier to set up in CI. However we are working on filling in some missing features and adding documentation.

    I want to learn from you all what we need to build before we replace 1.0 and release it officially. If you are interested in trying it out lets schedule a time and I will give you access https://calendly.com/jperl/60min

    Evgeniy Ostroverkhiy
    @hollligan
    @jperl Hello, are there any plans to update playwright to 1.5.2?
    3 replies
    sushmitha gayam
    @sushmithaGayam
    can you add support to scroll inside an iframe?
    1 reply
    Bratu Cătălin
    @CatalinBratu7

    Hi. I'm facing a small issue with my GitLab ci config and I thought maybe someone from here would be able to help me. I have multiple tests (different files) with await page.waitForTimeout. The files have different timeout values, basically I need to wait on different website if our single sign on solution logs out automaticaly the user. My problem is that if I have for example 3 tests, if the first test success the job/pipeline will close and it will not wait for the others to finish as well.
    qawolf:
    image: qawolf/playwright-ci:v1.0.0
    script:
    - npm install
    - npx qawolf test --headless
    variables:
    QAW_ARTIFACT_PATH: $CI_PROJECT_DIR/artifacts
    artifacts:
    when: always
    paths:
    - $CI_PROJECT_DIR/artifacts
    expire_in: 1 week
    File.test.js -> Example
    const qawolf = require("qawolf");

    let browser;
    let context;

    beforeAll(async () => {
    browser = await qawolf.launch();
    context = await browser.newContext();
    await qawolf.register(context);
    });

    afterAll(async () => {
    await qawolf.stopVideos();
    await browser.close();
    });

    test("After 45 minutes I should still be logged in CIM", async () => {
    const page = await context.newPage();
    await page.goto("https://xxxxxxxxxxxxxxxxxx/", { waitUntil: "domcontentloaded" });
    await page.check('"Normal"');
    await page.click(".primary");
    await page.click(".switcher");
    await page.click('[aria-label="Username"]');
    await page.fill('[aria-label="Username"]', "xxxxxxxxxxxx");
    await page.click("#password");
    await page.fill("#password", "xxxxxxx");
    await page.click(".submit");
    await page.waitForTimeout(2700000);
    const url = await page.url();
    expect(url).toEqual(expect.stringContaining('test-sso..com'));
    });

    Bratu Cătălin
    @CatalinBratu7

    Hi. I'm facing a small issue with my GitLab ci config and I thought maybe someone from here would be able to help me. I have multiple tests (different files) with await page.waitForTimeout. The files have different timeout values, basically I need to wait on different website if our single sign on solution logs out automaticaly the user. My problem is that if I have for example 3 tests, if the first test success the job/pipeline will close and it will not wait for the others to finish as well.
    qawolf:
    image: qawolf/playwright-ci:v1.0.0
    script:
    - npm install
    - npx qawolf test --headless
    variables:
    QAW_ARTIFACT_PATH: $CI_PROJECT_DIR/artifacts
    artifacts:
    when: always
    paths:
    - $CI_PROJECT_DIR/artifacts
    expire_in: 1 week
    File.test.js -> Example
    const qawolf = require("qawolf");

    let browser;
    let context;

    beforeAll(async () => {
    browser = await qawolf.launch();
    context = await browser.newContext();
    await qawolf.register(context);
    });

    afterAll(async () => {
    await qawolf.stopVideos();
    await browser.close();
    });

    test("After 45 minutes I should still be logged in CIM", async () => {
    const page = await context.newPage();
    await page.goto("https://xxxxxxxxxxxxxxxxxx/", { waitUntil: "domcontentloaded" });
    await page.check('"Normal"');
    await page.click(".primary");
    await page.click(".switcher");
    await page.click('[aria-label="Username"]');
    await page.fill('[aria-label="Username"]', "xxxxxxxxxxxx");
    await page.click("#password");
    await page.fill("#password", "xxxxxxx");
    await page.click(".submit");
    await page.waitForTimeout(2700000);
    const url = await page.url();
    expect(url).toEqual(expect.stringContaining('test-sso..com'));
    });

    I found the culprint, our shared runners had timeouts setted at 30 min.....

    3 replies
    G V Navin
    @gvnavin
    Hello team,
    I am exploring how to write test webapp test case quickly. I came across the qawolf. I am running it in my local to understand all the features. I have few questions to understand it better
    1. How to record video while running the tests in local ?
    2. How to record the logs while running the tests in local ?
    3. Can we make the qawolf to assert few items in the UI ?