Rename a test
A visual UI test is uniquely identified by the application and test names that you pass to the Eyes SDK open() method. You can rename both the application name and the test name. This article describes how to rename a test. See Rename an application for a description of how to rename an application.
Once you have renamed a test, Eyes will only use the baselines associated with the application and test name, if they use the new name. Note however that existing test results and baselines will still refer to the original name.
Below is an example of how to change a test called (incorrectly) "Helo Word test" that belongs to an application "Hello test app" and rename the test to "Hello World test" (adding a missing "l" in "Helo"):
- In your test code, change the 3rd parameter of the open() method to "Hello World test".
- Navigate to the Apps and test page using the page navigator and find the application "Hello World app" in the list of applications in the left panel. If the list is long, just type some text in the filter apps control, and the system will only display applications whose name contain the text you typed. (See Filter the list of applications for more details).
- Click on the application name, so that it becomes the current application and the main pane will be updated with all the tests of that application.
- Find the test whose name you want to change.
- Click on the menu that appears when you hover over a test and select the Rename option.
- A dialog box will open, type in the new name, or change the current name. Click the Rename button to make the change permanent, or click the Cancel button to abort the rename process.
// Original
WebDriver driver = eyes.open(
innerDriver,
"Hello World app",
"Helo World test",
viewportSize);
// After rename application name
WebDriver driver = eyes.open(
innerDriver,
"Hello World app",
"Hello World test",
viewportSize);
// Original
eyes.open(
innerDriver,
'Hello World app',
'Helo World test',
viewportSize);
// After rename application name
eyes.open(
innerDriver,
'Hello World app',
'Hello World test',
viewportSize);
// Original
var driver = eyes.Open(
innerDriver,
"Hello World app",
"Helo World test",
viewportSize);
// After rename application name
var driver = eyes.Open(
innerDriver,
"Hello World app",
"Hello World test",
viewportSize);
// Original
$this->driver = $eyes->open(
$this->innerDriver,
'Hello World app',
'Helo World test',
$viewportSize);
// After rename application name
$this->driver = $eyes->open(
$this->innerDriver,
'Hello World app',
'Hello World test',
$viewportSize);
# Original
driver = eyes.open(
driver=innerDriver,
app_name='Hello World app',
test_name='Helo World test',
viewport_size = viewport_size)
# After rename application name
driver = eyes.open(
driver=innerDriver,
app_name='Hello World app',
test_name='Hello World test',
viewport_size = viewport_size)
# Original
driver = eyes.open(
driver: inner_driver,
app_name: 'Hello World app',
test_name: 'Helo World test',
viewport_size: viewport_size)
# After rename application name
driver = eyes.open(driver: inner_driver,
app_name: 'Hello World app',
test_name: 'Hello World test',
viewport_size: viewport_size)
To quickly find the test in a long list of test name you can use the test name filter in the toolbar. See Filter the list of tests for details.
If the new name you provide was previously used as a test name in the same application, even if that test name was deleted, the system will give you an error message and will not allow you to complete the rename operation.
After renaming a test, you must use the new name in all your tests as shown in the first step. Using the old name would create a new test name, and all the test results would be considered "new".