Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:33:53+00:00 2026-06-11T21:33:53+00:00

Scenario: Modify and save an incomplete change to a Campaign Given I click on

  • 0

Scenario: Modify and save an incomplete change to a Campaign

Given I click on the Campaign section folder
And I press Save in the selected Campaign
Then I should see an error balloon informing the changes cannot be saved

Point is that this ‘error balloon’ in the final step is a ajax call which will then bring a green or red balloon according to the success of the operation. Currently what I do is after
‘And I press Save…’ I will do a sleep(3) to give it time for this balloon to show up. This doesn’t seem very smart coz you are wasting time and also because some times it can take more or less time for this call to be processed.

How do you guys make your behat tests wait for Ajax do be done instead of just putting the beasts to sleep?

thank you very much for any feedback!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:33:54+00:00Added an answer on June 11, 2026 at 9:33 pm

    This is done by waiting for your outstanding ajax calls to hit 0. jQuery.active will check just that for you.

    In your FeatureContext.php, you can do something like;

    public function iShouldSeeAnErrorBalloon($title)
    {
        $time = 5000; // time should be in milliseconds
        $this->getSession()->wait($time, '(0 === jQuery.active)');
        // asserts below
    }
    

    And do make sure you use a Mink Driver that runs javascript and ajax (the default does not).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: There is a website with 700-900 concurrent unique visitors at any given time.
I have a scenario where I need to modify certain functions within my plugin.
My scenario is : I've an excel sheet. Some threads need to modify it
There is a scenario. There is an ask-and-answer website. An answerer can modify his
I'd like to know what happens given the following scenario using the .net client.
Scenario : An binary file needs a svn lock to modify. To modify, the
I have the following scenario: Modify function takes an input object, and calls the
the scenarios are as follows scenario #1 someSchema.pre('save', function(next){ asyncFunction(function(){ this.sub.value = 'something' next()
Scenario : I'll try to put an analogy with the loan broker example from
Scenario first :- I'm using Entity Framework to do some queries, to build my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.