stronk7

Untitled

Apr 23rd, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. Example:
  2.  
  3. $ br --profile seleniumfirefox --suite classic --tags '~@javascript&&@mod_forum' --name 'Edit forum post'
  4.  
  5. Command: vendor/bin/behat --config /Users/stronk7/Sites/moodle_data_gitintegration/master/postgres_behat/behatrun/behat/behat.yml --profile seleniumfirefox --suite classic --tags '~@javascript&&@mod_forum' --name 'Edit forum post'
  6.  
  7. Moodle 3.7dev+ (Build: 20190418), 3339cbf26a23f638efe50f485f76ff793d41e807
  8. Php: 7.3.3, pgsql: 9.6.12, OS: Darwin 18.5.0 x86_64
  9. Server OS "Darwin", Browser: "firefox"
  10. Started at 23-04-2019, 23:28
  11. ..............
  12.  
  13. 1 escenario (1 pasaron)
  14. 14 pasos (14 pasaron)
  15. 0m5.84s (64.39Mb)
  16.  
  17.  
  18. Script:
  19.  
  20. $ cat br
  21. #!/bin/bash
  22.  
  23. # Don't stop on error
  24. set +e
  25.  
  26. # Move to base directory
  27. pushd "$(git rev-parse --show-toplevel)" > /dev/null
  28.  
  29. # Calculate path to config.yml file
  30. pathtoconfig=$(php -r 'define("CLI_SCRIPT", true);
  31. include "config.php";
  32. include("lib/behat/classes/behat_command.php");
  33. echo behat_command::get_behat_dir();')/behat.yml
  34.  
  35. # Add quotes back to show the complete command
  36. forcequoted="[[:space:]]|[&,]"
  37. quoted=
  38. for i in "$@"
  39. do
  40. if [[ ${i} =~ ${forcequoted} ]]; then
  41. i=\'${i}\'
  42. fi
  43. quoted="${quoted} ${i}"
  44. done
  45.  
  46. # Run behat passing all params straight to it
  47. echo
  48. echo "Command: vendor/bin/behat --config ${pathtoconfig} ${quoted}"
  49. echo
  50. vendor/bin/behat --config "${pathtoconfig}" "$@"
  51.  
  52. # Move back to original directory
  53. popd > /dev/null
Advertisement
Add Comment
Please, Sign In to add comment