I currently work in a igaming studio where I’m the sole QA. I test slot games and they original mini games for a crypto market.
I have a set of test cases for both but I’m currently thinking of automated some of the tests I do. I currently test them manually.
The slot games are canvas based so it’s hard to use selectors or classes. I can access the game via the game engine api via the network tab to view the spin, game round. Was thinking to start with api automated tests.
I have around 60 test cases maybe looking at 15% of them to automate which could be api or ui. I haven’t got much hands on automation experience. But learned a bit of it outside of work.
By API are you referring to javascript API within browser or REST APIs that the game in browser makes via AJAX? If you can control the game in browser with REST API calls made in network tab, or from executing javascript from the web console of browser, you could automate the test in UI but by using javascript as mechanism to perform automation and some validation there. Additional validation could be recording screenshot of the game rendering at various stages/states (or a video recording), and then do (automated) image comparison of the (cropped?) screenshot against a known benchmark of what to expect.
That’s what I would consider, and that’s the approach I took automating an HTML5 canvas of 3D object you can pan/zoom, controlling it from javascript APIs I asked developer to inject in for testability. The object rendered could then be compared with image comparison using screenshot and a saved reference image.
Dig into the API end, learn java/javascript (one is pork, the other is not pig) and about the back-end api. speak to some of the devs. Learn how to inject scripts into the web page - various plugins and various tools do let you do this, it’s a bit hacky, and you will learn a bit about security in web apps too, which is not a bad thing. But yeah , I would not go at it from a GUI perspective. Good luck most of all.
If the REST/web API calls are managed by javascript (API), you could use Selenium or perhaps Playwright to do the automation, and opt for headless browser after you’ve automation tested things with a visual browser. The tool (Selenium/Playwright) can launch your browser, into the slot game, then you run the tool to invoke/inject the javascript API calls to do the automation. Any visual output can then be image comparison against screenshots and benchmark image.
If you only want to purely test the APIs, then you should learn the API spec/doc, and automate with REST API tools instead of trying to use the javascript API which is for the browser, and extraneous to the actual work required other than maybe wanting to learn javascript or that special wrapper API.