Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    vanhai493
    @vanhai493
    https://prnt.sc/sn50sp this's code for me
    Peter Tesler
    @vptes1
    Hi @vanhai493 there is no such thing as a built-in "Take screenshot" step. You may want to turn on screenshots via a flag (run smashtest --help).
    Also, you may want to either indent that last step, or use the .. modifier
    vanhai493
    @vanhai493
    thank so much!
    vanhai493
    @vanhai493
    I using smashtest --screenshots=true but code auto take screen shot after each step. but I want take screenshot when I want, So is there any way?
    mdilovar
    @mdilovar
    Set user to type Admin
    Set user to type Read-Only
        Verify user can login
        Verify user can open an article
        // a bunch of other checks

    In the case above, can I limit parallelism so that Set user to type Admin and Set user to type Read-Only are never run in parallel?

    I know I can do:

    Start tests !
        Set user to type Admin
        Set user to type Read-Only
            Verify user can login
            Verify user can open an article
            // a bunch of other checks

    But that would remove all parallelism. I would like to still take advantage of some parallelism by first setting the user to Admin and running all the Verify steps in parallel AND THEN setting the user to Read-Only and running all the Verify steps in parallel again.

    mdilovar
    @mdilovar
    Is there any way I can do something like if(buttonDsiplayed) { do something;}?
    Craig Waite
    @craigvl
    @vanhai493 I think that a github issue has been created for this #51
    id7digital
    @id7digital
    Hi Guys, I'm running multiple parallel branches at a time, currently 4 for a large number of tests, a lot of the tests share the same function however and sometimes I get a timeout error - could it be the case the function is exclusive to one branch at a time and is possibly why this happens?
    Lalita Odang
    @Regenbogenkii
    Hi everyone, any possibility to test authentication via facebook and google. When I manually click on facebook login button on my site it popup authenticated fb window for filling up facebook account then the window close and login to my site. But with running on smashtest nothing happen after tell it to click the button. So anyone know how to make test on this thing.
    1 reply
    Lalita Odang
    @Regenbogenkii
    I have another question. How can I check if the exact element has "active" class or a specific color when active
    Craig Waite
    @craigvl

    @Regenbogenkii I think you would want to define a prop that has an element finder that describes the element with the active class you can then verify this prop after you have made the element active

    * On todomvc page {
            props({
                'updateButton': `.update`,
                'updateButtonActive': `.update.active`
            });
        }
    
    * When Update button is clicked
        Click  'updateButton'
    
    * Then Update button is active
        Verify 'updateButtonActive'

    You can then use the above functions something like:

    Given I am at todomvc
        When Update button is clicked
            Then Update button is active
    Craig Waite
    @craigvl
    So quiet in here? Everyone still using smashtest?
    Marton Sari
    @sarimarton
    I just introduced smashtest at my new company, a relatively big US educational business. We're a small team owning 2 complex UI projects, and I was doing a spike for having a test strategy. I did a smashtest POC and they really liked it, but I ran into that dreaded ECONNERROR issue which was discussed earlier here, and there's a (now closed, due to inactivity) issue for it on github.
    I would hate to use cypress, but this problem is a showstopper currently
    Marton Sari
    @sarimarton
    Disabling parallel running seems like a workaround
    Marton Sari
    @sarimarton
    Option 1 mentioned at https://smashtest.io/getting-started/setup indeed works, but it's misleading that mac users are led to use webdriver-manager instead of selenium-standalone which is mentioned for Windows users. To me, only the "windows" version worked, that is, selenium-standalone.
    Craig Waite
    @craigvl
    @sarimarton So just to confirm, if you use selenium-standalone you are able to run parallel tests on a mac?
    Marton Sari
    @sarimarton
    Yeah, it was kind of stress tested with up to 160 tests (the same login test subroutine copy-pasted under each other, generating 160 branches), and it beautifully worked, wasn't flaky, although cypress was very flaky on a simple step (the same 160-times-repeated test were implemented in cypress too to compare speeds and things like flakiness etc.) Smashtest ran 5 tests in parallel and it did it in 7 minutes. Cypress did it in double the time, but of course without paralellization. There were other problems with cypress too - broken install in our repo, only in a clean repo did the examples run at all, and cypress thought some of our login elements are not visible, because of some overflow: hidden rules in the css, so I had to use force: true on every step. It's a horrible, bloated experience.
    One gotcha with smashtest was that it was fast only with screenshots disabled. If screenshots were enabled, it slowed down exponentially, even 10 tests went into the 5-10 minutes range, not to mention even more. It's not a problem when debugging one branch though, but it's definitely a bug which should be addressed in the long run.
    Marton Sari
    @sarimarton
    To me, the tree format, the heuristic element matcher and the human readable macro language makes no question it's the number 1 tool for UI testing, I'd regret if it just sinks in oblivion. Thanks god it's in a good shape now!
    Craig Waite
    @craigvl
    Yes I also love smashtest, we had a conversation regarding sceenshots here, #51 , my biggest concern at the moment is that I have not seen the Founder @vptes1 on here for quite a while or on github , I will continue to reach out to him to see if he is still around.
    Peter Tesler
    @vptes1
    Hi guys. I'm here, just not as active as before. I'll still be available to approve pull requests, etc. if the need arises.
    Thanks for all of your continued support!
    Craig Waite
    @craigvl
    @vptes1 Great thanks.
    Craig Waite
    @craigvl
    @sarimarton @vptes1 So we should update https://smashtest.io/ to indicate that selenium-standalone is the best option for both Windows and Mac? If so is the website code for https://smashtest.io/ on github?
    Marton Sari
    @sarimarton
    @craigvl Sorry for the late reply, I didn't notice that I don't receive notifications for a while. Yeah, the wording should be updated that either one of the methods should work, but it's not related to Mac vs Windows - as @vptes1 confirmed to me too.
    mendhak
    @mendhak
    Has anyone been able to set a screen resolution when running a smashtest? I see the capabilities/options page, which points at Selenium's documentation, but I'm at a loss as to what I need to set. It's very difficult to wade through it and various StackOverflow posts mentioning different things. I'm just randomly applying values but the screenshots being produced are still 1000x750.
    Open Chrome 
    
        Set custom capabilities {
    
            g('browser capabilities', {
                "browserName": "chrome",
                "platformName": "linux",
                "screenResolution": "1920x1080",
                "resolution": "1920x1080",
                "se:options": {
                    "timeZone": "US/Pacific",
                    "screenResolution": "1920x1080"
                }
                });
        }
    DorkForce
    @DorkForce

    Should I be able to use Smashtest against an internally-hosted Moon server? The instructions my company gives for standard javascript connection are as follows:

    var webdriverio = require('webdriverio');
    
    var options = {
      host: 'https://moon.myCompany.com/wd/hub',
      desiredCapabilities: {
        browserName: 'chrome',
        version: '86.0',
        enableVNC: false,
        enableVideo: false
      }
    };
    var client = webdriverio.remote(options);

    And I was launching Smashtest with cls; smashtest --test-server=https://moon.myCompany.com/wd/hub against this test:

    Set custom capabilities {
        g('browser capabilities', {
            'browserName': 'Firefox',
            'version': '87',
            'enableVNC': false,
            'enableVideo': false
        });
    }
    
    Open Firefox
    
        Navigate to 'google.com'
    
            Type 'hello world[enter]' into 'textbox'
    
            Type 'hello universe[enter]' into 'textbox'

    But I receive UNABLE_TO_VERIFY_LEAF_SIGNATURE unable to verify the first certificate for each Navigate step.

    2 replies
    potjerodekool
    @potjerodekool

    I have an application with a login page which calls a rest service. How do I mock the api call? I tried the code below in my smashtest but I get a network error in my application.

    Mock auth {
    await mockHttp('POST', 'http://localhost/auth/authenticate/', '{ "authToken": "ey437854"}');
    }

    slowmonkey
    @slowmonkey

    Hi,

    Is there a way to get all elements div elements that has a classname of 'classnameX' and click on it and then take a screenshot without having to write a code block/javascript?

    Basically I want to do the following:

    Get all the div elements with a class of 'tabs' on a web page and click on it.
    Then wait 30s for the page to load because it has lots of visuals on it.
    Then scroll to every div element within a div.grid-layout element to view the visuals generated on that tab to take a screenshot.

    Is there a way for me to do all that without having to write a boat load of javascript?

    slowmonkey
    @slowmonkey
    For instance I want to do something like this that leverages the branching of smashtest. But it's saying elem.click is not a function.
    * Get report tabs {
         return await $$('.tab');
    }
    
    {reportTab} = Get report tabs
    
        Click {reportTab}
    slowmonkey
    @slowmonkey

    So, I've discovered there is no way to loop through a list of elements with a list of actions.

    So, what I had to do was to use the ordinal prop and manually look at how many elements I needed to act upon.

    So the code looks like this:

    Open Chrome
    
        On homepage {
            props ({
                'report tab': '.tab'
            })
        }
    
            Click '1st report tab'
    
            Click '2nd report tab'
    
            Click '3rd report tab'
    
            Click '4th report tab'

    This only shows if there was one operation. But what if I had a set of operations?

    Open Chrome
    
        On homepage {
            props ({
                'report tab': '.tab'
            })
        }
    
            Click '1st report tab'
    
                Click_through_4_sub_tabs
    
            Click '2nd report tab'
    
                Click_through_12_sub_tabs
    
            Click '3rd report tab'
    
                Click_through_1_sub_tabs
    
            Click '4th report tab'
    
                Click_through_13_sub_tabs

    For this I had to create an illusion of having a dynamic set of operations. Here I had to manually create 13 functions to click through tabs 1 to 13. Then I had to manually discover how many sub tabs for each report tab there were and use that function that matched the number of available sub tabs.

    Hope this helps anyone that wants to do something similar.

    slowmonkey
    @slowmonkey
    @vptes1 Is the documentation (smashtest.io) available for contribution? I'm sure there are some of us that would like to create pull requests to help bolster the documentation.
    slowmonkey
    @slowmonkey
    image.png

    Need help with how to click a button on a page if it's not disabled.

    Currently I have the following and in "Initialise page" I have the following

    * Initialise page {
        let elem = await ${'button[text='click me']:enabled}
        if (elem != null) {
            elem.click();
        }
    }

    The elem.click() does nothing.

    elem is this:

    WebElement {
      driver_: mixin {
        session_: Promise { [Session] },
        executor_: Executor { w3c: true, customCommands_: [Map], log_: [Logger] },
        fileDetector_: null,
        onQuit_: undefined
      },
      id_: Promise { '40238d6e-dd40-441d-840c-f214263a9942' }
    }
    mendhak
    @mendhak

    @vptes1 Is the documentation (smashtest.io) available for contribution? I'm sure there are some of us that would like to create pull requests to help bolster the documentation.

    +1 to this . It would be good to contribute to the documentation with more examples. @vptes1 Maybe you could transfer the pages to a Github repo? Github allows custom domains so smashtest.io can point at your repo and we just do PRs against it.

    ijazdar
    @ijazdar:matrix.org
    [m]
    Hi,
    I'm trying to find the element through this example but facing this error "rror: Element not found in time (2 s): ". Any one please tell me how can i use it in my code for smashtest automation ?
    ijazdar
    @ijazdar:matrix.org
    [m]
    This code is opened in console once i clicks on the drop down, anyone please help me to get element from this example?. Thanks
    slowmonkey
    @slowmonkey
    Hi @ijazdar:matrix.org , can you show your smashtest code please. Is the ConsoleExample_Code.png the html you're trying to find?
    ijazdar
    @ijazdar:matrix.org
    [m]
    slowmonkey (slowmonkey):
    Here's the smashtest code which i'm trying for the shared example
    click '#Testing option[value="mytest"]'
    slowmonkey
    @slowmonkey

    @ijazdar:matrix.org
    Is there a report.html generated? or do you have this test sample in a github repo?
    A good way to find out if it's working for me is.

    1. Use a browser in developer mode and find the element via the css selector you're specifying.
    2. Another thing to check is in the report.html if you've got screenshots on you can check for that step if the page is fully loaded before the step is executed. That way you can see that it's got something to find. If it's timing out that can be a reason why because the page isn't loaded and it's timed out trying to find a non-existing element.

    From what I can see of your images should it not be

    click '#Testing option[value="MT"]'

    ijazdar
    @ijazdar:matrix.org
    [m]

    @slowmonkey:
    Appreciated for your help.

    Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" drop but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.

    Thanks

    Open Chrome

    Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
        [
            // Wait 5 secs to load the page
            Wait '10' secs
                Click ['Change language']
                    Click '#language-selector option[value="de"]'
        ]
    ijazdar
    @ijazdar:matrix.org
    [m]

    :point_up: Edit: slowmonkey (slowmonkey):
    Appreciated for your help.

    Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" drop but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.

    Thanks

    Open Chrome

    Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
        [
            // Wait 5 secs to load the page
            Wait '5' secs
                Click ['Change language']
                    Click '#language-selector option[value="de"]'
        ]

    :point_up: Edit: slowmonkey (slowmonkey):
    Appreciated for your help.

    Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" dropdown but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.

    Thanks

    Open Chrome

    Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
        [
            // Wait 5 secs to load the page
            Wait '5' secs
                Click ['Change language']
                    Click '#language-selector option[value="de"]'
        ]

    :point_up: Edit: slowmonkey (slowmonkey):
    Appreciated for your help.

    Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" dropdown but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.

    Thanks

    Open Chrome
    Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
    [
    // Wait 5 secs to load the page
    Wait '5' secs
    Click ['Change language']
    Click '#language-selector option[value="de"]'
    ]
    ```

    :point_up: Edit: slowmonkey (slowmonkey):
    Appreciated for your help.

    Please see the below code and UI for the shared query. I'm trying to select the language "Deutsch" from the "Change language" dropdown but receiving an error "Error: Element not found in time (2 s)". I've also checked there's no any timeout error before my last line against which element isn't found. Could you please check and shared your thoughts to fix this issue.

    Thanks

    Open Chrome
    Navigate to 'https://developer.mozilla.org/en-US/docs/Tools/'
    [
    // Wait 5 secs to load the page
    Wait '5' secs
    Click ['Change language']
    Click '#language-selector option[value="de"]'
    ]