Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Craig Waite
    @craigvl
    Have done the above work, let me know if you would like a PR
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    So I still can't get it to work in Docker so I thought I would try a different approach. I started up an Ubuntu 18.04 server with no graphical desktop. When root runs the test it fails with the error but when an untrusted user runs it the tests all complete and pass. I have a few other things to check on like host logs and see if there is something being reported.
    Craig Waite
    @craigvl

    @vptes1 In the process of creating a unit test for my PR I now see that I can do

    contains exact 'FOO BAR'

    Is this is the doco somewhere ?

    Peter Tesler
    @vptes1
    @craigvl not sure what you mean
    contains exact is documented in the list of built-in props
    it was actually one of the original built-in props, but isn't that popular so it's not used in too many examples
    Craig Waite
    @craigvl

    I had no idea that for the 'text' search you are able to pass "contains exact" as I was just reading the info on page https://smashtest.io/ui-testing/elementfinders under "Matching rules" for the 1. 'text' section

    Think that it might be good to add a note about the fact that you can pass 'contains exact' to that area of the doco?

    RoyceTheBiker
    @RoyceTheBiker_gitlab
    It looks like the workaround to getting webdriver to run Chrome in Docker is to add --disable-dev-shm-usage according to Running webdriverio tests using headless chrome in Docker so now I am looking for this config file and see if I can make that work. Adding it as an option to webdriver-manager start did not help.
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    I have Firefox 100% working from within Docker but Chrome is still acting up.
    mendhak
    @mendhak

    @RoyceTheBiker_gitlab We run our smashtests in Docker, both FF and Chrome. I'm going to paste a Dockerfile and a docker-compose.yml here. Try this yourself.

    The Dockerfile

    FROM node:12.9.1
    ENV PATH="/code/drivers/linux:${PATH}"
    
    ARG WORKDIR=/code/
    
    WORKDIR ${WORKDIR}
    
    COPY ./package.json ${WORKDIR}package.json
    COPY ./package-lock.json ${WORKDIR}package-lock.json
    RUN npm install
    COPY . ${WORKDIR}
    
    CMD env

    Then the docker compose yml

    version: "3.4"
    
    services:
      testserver:
        depends_on:
          - firefox
        image: "my/test-runner"
        volumes:
          - ./smashtest:/code/smashtest
          - ./:/code/
    
        build:
          context: .
          dockerfile: Dockerfile
        command: bash -c "npx smashtest"
      firefox:
        image: "selenium/standalone-firefox:latest"

    And finally I run it like

    docker-compose run --rm testserver npx smashtest
    The ./smashtest is a volume mount because the report.html is output there.
    The ./ is volume mounted too so that I can make changes to .smash file and just rerun quickly
    Similar for chrome, just using the selenium standalone. So not having to worry about the driver
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    Thanks @mendhak. I see your base is node, I don't think my problem is in node. I think the problem is that I am trying to do too much in one docker image. I chose Debian so that I could run Chrome and Firefox in one image and node for the most part works just fine. I think Chrome and Firefox should be in Debian with smashtest and webdriver in another. I will use docker-compose to connect them and see if that works better.
    Craig Waite
    @craigvl
    I find that I am often wanting to await a whole list of props for the "on page x" steps, would it be good to have a method that you could just call that would just apply await $$(prop) for all the props ? Does that make sense? Could just add as an enhancement on GitHub?
    Peter Tesler
    @vptes1
    Not sure what you mean @craigvl You can always list multiple props inside a single $() or $$() (and use any order if they're not in order).
    Maybe give an example?
    Craig Waite
    @craigvl
    * On home page {
            props({
                'contactUs': 'a[href*="contact"]',
                'joinIn': 'a[href*="join-in"]',
                'siteMap': 'a[href*="site"]',
                'legals': 'a[href*="legals"]',
                'privacy': 'a[href*="privacy"]'
            });
    
           await allProps();
        }
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    I have Smashtest working in Docker with Chrome and Firefox. Tests can be run via SSH. Next weekend I am going to look at adding a frontend WSI to upload and manage tests from the browser.
    smashtestio/smashtest#59 has been submitted.
    Peter Tesler
    @vptes1
    @RoyceTheBiker_gitlab Thank you!

    @craigvl I'd recomment this:

    * On home page {
        await $(`
            a[href*="contact"]
            a[href*="join-in"]
            a[href*="site"]
            a[href*="legals"]
            a[href*="privacy"]
        `);
    }

    Or

    * On home page {
        props({
            'contact us': 'a[href*="contact"]',  // I always prefer non-camel case :)
            'join in': 'a[href*="join-in"]',
            'site map': 'a[href*="site"]',
            'legals': 'a[href*="legals"]',
            'privacy': 'a[href*="privacy"]'
        });
    
        await $(`
            contact us
            join in
            site map
            legals
            privacy
        `);
    }
    Craig Waite
    @craigvl
    Great thanks.
    Peter Tesler
    @vptes1
    :thumbsup:
    slowmonkey
    @slowmonkey
    @RoyceTheBiker_gitlab are you able to explain the difference in approach with what you've provided vs what @mendhak posted? I'm a little confused.
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    @mendhak has a separate container for the testserver and another for firefox. The problem I was having was with Chrome. My QA team uses Chrome mostly so I really wanted a solution that could do Chrome. @mendhak's solution uses prebuilt node and firefox, so there is a lot less downloading of packages. They could be smaller in size as they are optimized for the specific task. I chose Debian because I plan to expand on the tool and give it a management frontend so that QA staff can use the tool without needing to be experts on comand line.
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    @slowmonkey the docker setup that @mendhak provided is a different approach. I thought about splitting my setup into multiple containers, there are some reasons to do that. I could revisit that later.
    mendhak
    @mendhak

    @RoyceTheBiker_gitlab Selenium provides a selenium/standalone-chrome:latest image as well, I use that for Chrome tests.

    I think the difference is, my approach is focused on CI/CD running and running headless locally.
    Your container seems focused on providing a managed tool to QA people so they don't have to worry about what docker is. I wouldn't use that on a CI server though, as you said before, it's doing too much.

    RoyceTheBiker
    @RoyceTheBiker_gitlab
    @mendhak the selenium-chrome image would be cool. I think it would solve the memory issue with Chrome, but also introduce a problem of not being able to run Chrome and Firefox tests from the same smash set, maybe. Someone with more selenium experience then myself would know.
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    I think the next thing I want to do is connect to the Docker using Jenkins.
    mendhak
    @mendhak
    Yeah to do browsers together you essentially need a Selenium Hub. I've been looking at running Selenium Grid in ECS: https://code.mendhak.com/selenium-grid-ecs/
    Snoopiisz
    @Snoopiisz_twitter
    Hi guys, i heve a question, i need to import test in other file test with special path like this :
    image.png
    have you some solution for import test in other test with out use smashtest + path command ?
    Peter Tesler
    @vptes1
    @Snoopiisz_twitter I would advise going into /Tests and running smashtest --recursive
    In smashtest there is no importing. You just have to include the files you want to run in the smashtest command.
    Snoopiisz
    @Snoopiisz_twitter
    ok thanks :) i found a solution, for running 1,2,3 or more test i juste make a script python for regroupe all .smash in the temporary .smash and run it, with this methode i can choose test i want run with a big recursive project
    snoopiisz
    @snoopiisz
    why choose python? because it is much simpler and faster just to read the files in recursive mode.
    File management is also done much faster, especially on fairly large volumes.
    I also find it much easier & faster to integrate python into a CI / CD routine than nodeJS.
    Craig Waite
    @craigvl

    I think that you have mentioned this before but I am unable to find in the doco.

    I have a test that sets a username and password and don't want these values to show in the report?

    Peter Tesler
    @vptes1
    @craigvl You can use the +? modifier to hide the whole step from the report, or make it a step with a code block and set the password from the code block
    Craig Waite
    @craigvl
    Thanks
    simonhorner
    @simonhorner
    Hi, can anyone tell me how I can set the class(Name) on an element?
    Marton Sari
    @sarimarton
    You can use webdriver code (though I wonder why you want to do that)
    simonhorner
    @simonhorner
    Thanks, I'm trying to implement a test for file upload. I've tried to interact with the file browser but couldn't find a way. I want to add a class to make the file path input textbox visible so I can enter the filename in it.
    Morgan Leroux
    @MrGlox
    Hi guys ! First of all, Thanks for your amazing testing solution ! I just have some struggle with the tab key press gestion, you have already [enter] but I can't found something reladted with others keys
    Peter Tesler
    @vptes1
    @MrGlox There's a link in the documentation to https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/input_exports_Key.html [tab] should work as well
    Morgan Leroux
    @MrGlox
    Alright, didn't know about that ! I tried something alike by reflex, maybe I was wrong somewhere but I now I can be sure it will works. Thanks !
    snoopiisz
    @snoopiisz
    I guys, i think the color of reporting is no readable for CI/CD darkgrey on black not good, we can change this color ? why no white color ?
    Peter Tesler
    @vptes1
    @snoopiisz you can always submit a pull request for allowing users to customize the background color of the report. The majority of devs/testers prefer a dark theme which is why we went with that.
    shibupanda
    @shibupanda
    Can I get doc for config.json setup for smashtest
    shibupanda
    @shibupanda
    Is there any plan to support Appium keywords?