Skip to main content
Participant
February 26, 2020
Question

Is it possible to test PS script automatically?

  • February 26, 2020
  • 1 reply
  • 393 views

For example you write script with some UI and some user input.

You want to test if everything works right.

You can test script manually, but it is time consuming especially when your GUI is complicated and you have multiply cases to check.

 

Below is simple example:

 

#target photoshop
$.level = 1; // Debugging level, Level: 0 - No Break, 1 - Break, 2 - Immediate Break

var mainWindow = new Window("dialog", "Test buttons");
var buttonFoo = mainWindow.add("button", undefined, "foo");
var buttonBar = mainWindow.add("button", undefined, "bar");

buttonFoo.onClick = function(){
  alert("Fooo!");
}
buttonBar.onClick = function(){
  alert("Baar!");
}

mainWindow.show();

 

 

Here is gif in which I show what I want to do automatically:

 

Requirements:

  1. I want to run test by one click.

  2. The test need to be platform independent and it should run on all photoshop versions above 13.0 (CS6).

  3. (If is it possible) The test should be independent from user's PS layout.

  4. (If is it possible) It should not be important where buttons on UI's layout are located.

--------------------------------------------

Notes:

  • I know that photoshop is parsing code before running to find bugs, but this is not what I mean.

  • The test should mimic user behaviour (it's not important for me if I see results of test until some error or bug show up).

  • My system is Windows 10, but it would be nice if test could work on Mac also.

 

If you can answer question even partially I would be grateful.

Thanks in advance for any help.

    This topic has been closed for replies.

    1 reply

    JJMack
    Community Expert
    Community Expert
    February 28, 2020

    Not possible

    JJMack
    LukkarAuthor
    Participant
    March 10, 2020

    Thanks