Both sides previous revisionPrevious revision | |
videos:testing_1 [2023/05/09 20:57] – [Transcript] crhallberg | videos:testing_1 [2023/05/09 20:58] (current) – [Transcript] crhallberg |
---|
// Complete ~/chrome-headless.sh: // | // Complete ~/chrome-headless.sh: // |
| |
#!/bin/bash | <code bash> |
google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --window=size="1366,768" --disable-extensions | #!/bin/bash |
| google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --window=size="1366,768" --disable-extensions</code> |
| |
So I am going to copy my ''chrome-headless.sh'' to another script, which I'm going to call ''chrome-testmode.sh''. And I'm going to edit that. And I'm just going to take off the headless switch, so this is going to create all the same settings, but this will let me actually see what chrome is doing while the tests run, which can be useful, particularly if the test is failing and you want to see why. | So I am going to copy my ''chrome-headless.sh'' to another script, which I'm going to call ''chrome-testmode.sh''. And I'm going to edit that. And I'm just going to take off the headless switch, so this is going to create all the same settings, but this will let me actually see what chrome is doing while the tests run, which can be useful, particularly if the test is failing and you want to see why. |
// Complete ~/chrome-testmode.sh: // | // Complete ~/chrome-testmode.sh: // |
| |
#!/bin/bash | <code bash> |
google-chrome --disable-gpu --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --window=size="1366,768" --disable-extensions | #!/bin/bash |
| google-chrome --disable-gpu --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --window=size="1366,768" --disable-extensions</code> |
| |
So I have these two scripts now I can start up chrome in either headless mode or test mode, as I see fit and I don't have to type all of those many parameters anymore because they're all just saved in these convenient scripts. Alright, we're getting closer there is just one more script that we need to create, and this is going to be phing.xml in my home directory. We need this because, as I mentioned, there are all of these Phing properties that we need to be able to override and it's just more convenient to do that in the script, so we don't have to type them every time we run tests. | So I have these two scripts now I can start up chrome in either headless mode or test mode, as I see fit and I don't have to type all of those many parameters anymore because they're all just saved in these convenient scripts. Alright, we're getting closer there is just one more script that we need to create, and this is going to be phing.xml in my home directory. We need this because, as I mentioned, there are all of these Phing properties that we need to be able to override and it's just more convenient to do that in the script, so we don't have to type them every time we run tests. |
// Complete ~/phing.sh: // | // Complete ~/phing.sh: // |
| |
#!/bin/bash | <code bash> |
source /home/dkatz/testenv.sh | #!/bin/bash |
if [ ! -e $VUFIND_HOME/vendor ] | source /home/dkatz/testenv.sh |
then | if [ ! -e $VUFIND_HOME/vendor ] |
cd $VUFIND_HOME | then |
composer install | cd $VUFIND_HOME |
fi | composer install |
$VUFIND_HOME/vendor/bin/phing -Dapacheconfdir="/etc/apache2/conf-enabled" -Dapachectl="sudo /etc/init.d/apache2" -Dmysqlrootpass=tutorial -Dvufindurl=http://localhost/vufind_test -Dmink_driver=chrome $* | fi |
| $VUFIND_HOME/vendor/bin/phing -Dapacheconfdir="/etc/apache2/conf-enabled" -Dapachectl="sudo /etc/init.d/apache2" -Dmysqlrootpass=tutorial -Dvufindurl=http://localhost/vufind_test -Dmink_driver=chrome $*</code> |
| |
So now if I say ''phing.sh startup'' again. It's going to automatically reinstall my dependencies for me, and then it will start up the system again. | So now if I say ''phing.sh startup'' again. It's going to automatically reinstall my dependencies for me, and then it will start up the system again. |