A basic blackjack web application to get experience using selenium as a testing method.
Some code taken from the web (spring documentation), see:
Building this project requires git (or download it manually), and maven.
git clone https://github.com/Sacredify/4004-SeleniumBlackjack.git
cd 4004-SeleniumBlackjack
mvn clean install
Two options:
mvn clean install --log-file resultbj.txt
mvn clean install > resultbj.txt
Build the project as above to assemble the stand-alone jar.
java -jar SeleniumBlackjack-1.0-SNAPSHOT.jar
Allow the code to run until you see this message:
... c.c.blackjack.BlackJackApplication : Started BlackJackApplication in 4.512 seconds
After that, open any browser and navigate to:
http://localhost:8080/
Running the tests (selenium) is best done through maven:
mvn clean test
Tests aren't run as part of the build process, although they are compiled for errors.
For the eclipse users, you can:
git clone https://github.com/Sacredify/4004-SeleniumBlackjack.git
- `File --> Import --> Maven --> Import existing maven projects --> 4004-SeleniumBlackjack --> pom.xml selected.
- From there, you can do whatever. Select the main class (BlackJackApplication) and run (as application).
- To run the tests, you can right click src/test/java/ and do run as JUnit which will run both selenium (allow the browser to do its thing, or switch to PhantomJS) and cucumber tests.
- When someone disconnects, if they were the admin, the entire game shuts down. Re-connect as a new admin.
- When someone else disconnects, they will be replaced by an AI.
- Aces are automaticlly converted when possible.
- And probably some other stuff.
- The cucumber tests cover basic AI functionality and whatnot.
- The selenium tests will try to run through an actual game.
- I'm not spending 100% more time making it 'truly testable' by allowing custom input - thats not the point of this assignment.
- Please note there may be timing issues with the tests - they worked for me but selenium is like that. Try re-running them. Who knows?