]> git.parisson.com Git - mezzo.git/commitdiff
[WIP] add selenium yml file
authorAntoine Lebrun <antoinelebrun@touriste-147-81.ircam.fr>
Thu, 17 May 2018 10:02:44 +0000 (12:02 +0200)
committerAntoine Lebrun <antoinelebrun@touriste-147-81.ircam.fr>
Thu, 17 May 2018 10:02:44 +0000 (12:02 +0200)
app/runtests.py
docker-compose.yml
env/selenium.yml [new file with mode: 0644]

index 2f9c2aeefd5f25e29b15d17bfe165fcc13002a4b..61efbb0fd16943bd62388ff6aa4f1a2c9eba56fc 100644 (file)
@@ -1,11 +1,13 @@
 from subprocess import call
-import sys
+import organization
+import sys, inspect
 tests_to_run = []
 params = []
 def choose_arguments():
     print("\nToo few arguments. You can use : \n\n -all : to run all mezzo tests\n -mezzanine : to run only mezzanine tests")
     print(" -agenda : to run mezzanine-agenda tests \n -organization : to run mezzanine-organization tests\n -cartridge : to run cartridge tests ")
-    print(" --front : to run only front tests \n --back : to run only back tests\n\n You can also use all manage.py options ( as --failfast)")
+    print(" --front : to run only front tests \n --back : to run only back tests \n [PATH] = to run a test yourself")
+    print("\n You can also use all manage.py options ( as --failfast)")
     return input("\n'yes' to run all tests, 'no' to cancel : ")
 
 def execute():
@@ -23,7 +25,7 @@ def bad_arguments():
     if choose_arguments()=='yes':
         add_all_tests()
     else:
-        sys.exit()    
+        sys.exit()
 
 if len(sys.argv)==1:
     bad_arguments()
@@ -35,6 +37,8 @@ else:
             params.append("--pattern=*back.py")
         elif arg == "-all":
             add_all_tests()
+        elif "/" in arg:
+            tests_to_run.append(arg) 
         elif arg == "-agenda":
             tests_to_run.append("/srv/lib/mezzanine-agenda")
         elif arg == "-mezzanine":
@@ -43,10 +47,15 @@ else:
             tests_to_run.append("/srv/lib/mezzanine-organization")
         elif arg == "-cartridge":
             tests_to_run.append("/srv/lib/cartridge")
-        elif arg!= "runtests.py":
+        elif "-" in arg:
             params.append(arg)
-execute()
-    
+        elif arg!= "runtests.py":
+            tests_to_run.append(arg)
+        
+if len(tests_to_run)>0:
+    execute()
+else:
+    print("You have to specify a test suite")    
 
 
 # All : python manage.py test /srv/lib/cartridge /srv/lib/mezzanine /srv/lib/mezzanine-agenda /srv/lib/mezzanine-organization --keepdb
index ce072e9da633ac4a67c2bc5f8b4e959df7dd8cfc..d881b8691f7d6c7a91881aafb381e3bb5a9baef7 100644 (file)
@@ -62,3 +62,4 @@ app:
 
 nginx:
     image: nginx
+
diff --git a/env/selenium.yml b/env/selenium.yml
new file mode 100644 (file)
index 0000000..57829ab
--- /dev/null
@@ -0,0 +1,32 @@
+# To execute this docker-compose yml file use docker-compose -f <file_name> up
+# Add the "-d" flag at the end for deattached execution
+firefox:
+  image: selenium/node-firefox:3.11.0-dysprosium
+  volumes:
+    - /dev/shm:/dev/shm
+  links:
+    - hub
+  environment:
+    HUB_HOST: hub
+    HUB_PORT: '4444'
+
+chrome:
+  image: selenium/node-chrome:3.11.0-dysprosium
+  volumes:
+    - /dev/shm:/dev/shm
+  links:
+    - hub
+  environment:
+    HUB_HOST: hub
+    HUB_PORT: '4444'
+
+hub:
+  image: selenium/hub:3.11.0-dysprosium
+  ports:
+    - "4444:4444"
+  expose:
+    - "4444"
+
+app:
+  links:
+    - hub
\ No newline at end of file