I’ve become a big fan of LambdaTest recently. As I use Golem as my internal test framework, it was a breeze to point my browsers to the LambDa framework as a remote browser/grid. However, when I first started I noticed my tests came through as random token’s for names:

XNDND-DNDND-NDNDN-NDNDN <- such a test name isn’t very useful to link back to my own local report. I’d like the name of the test to populate that value.

LambdaTest gets the name of the test from the build and name values passed in the capabilities. For example, if you sent:

capabilities = {
		"build" : "Android S20",
		"name" : "Validating login",
		"platformName" : "Android",
		"deviceName" : "Galaxy S20 Ultra",
		"platformVersion" : "10",
		"network": True  
	}

The test will come through with the name Android S20. That’s great, but it isn’t dynamic. I have 40+ tests currently and they all can’t share the same name. They need to have the test being executed as the unique name.

Looking at Golem’s codebase on Github, I saw this execution class:

https://github.com/golemhq/golem/blob/master/golem/execution.py

Note the options here:

test_file = None
browser = None
browser_definition = None
browsers = {}
data = None
secrets = None
description = None
settings = None
test_dirname = None
test_path = None
project_name = None
project_path = None
testdir = None
execution_reportdir = None
testfile_reportdir = None
logger = None
tags = []
environment = None

The test_file option does the trick. It will pass the Test folder [.] Test Name, which is exactly what I wanted….

Back in my test framework, I modified my browsers.py file (this file is created by the user in the root of a project folder within Golem). That file contains all the manually defined browsers you want to support, very useful for remote browsers. I modified the capabilities like so:

from golem import execution # adding an import for the execution class

def iPhone11(settings):
    capabilities = {
		"build": execution.test_file,
		"name": execution.test_file,
		"platformName": "iOS",
		"deviceName": "iPhone 11",
		"platformVersion": "14.2"
    }

Running the test now, I get this result in LambdaTest’s Dashboard:

Now I know exactly what’s been tested and executed.

#

No responses yet

Leave a Reply

Your email address will not be published.

Archives
Categories