Site Testing

Certified Senior Developer

An often occuring frustration when testing out an interface is that it will work fine within the interface editor, but once we throw it on a site, something goes wrong. That wouldn't be too big a deal as it's all part of development, but whenever we test interfaces on a site, there is no way to see what values the variables are getting for diagnostic purposes. We can hide/show the components on the site, but is there some way for developers to also see variable values? 

  Discussion posts and replies are publicly visible

Parents
  • I will put variable values into text or paragraph fields for debugging.  Specifically, I use a rule!DEBUG() interface that internally shows a red a!boxLayout with the passed ri!label and ri!value from the primary interface.  I have these set to show only in lower environments, and only to system administrators.  Works great, you can even leave the code in up to production.  rule!isDev() and rule!isTest() check an environmental constant cons!SERVER, which holds DEV, TEST or PROD depending on the server.  rule!isDev() returns true for cons!SERVER="DEV", etc.

    On occasion for trickier debugging I'll put a section in that will show for system admins up to production, users report an issue, I can view their task with my debugging info right on the screen, which they cannot see.

    Something like:

    a!boxLayout(
      label: "DEBUG",
      style: "ERROR",
      showWhen: and(
        fn!isusersystemadministrator(loggedInUser()),
        or(
          rule!isDev(),
          rule!isTest()
        )
      ),
      contents: {
        a!paragraphField(
          label: ri!label,
          value: ri!value,
          readOnly: true
        )
      }
    )

Reply
  • I will put variable values into text or paragraph fields for debugging.  Specifically, I use a rule!DEBUG() interface that internally shows a red a!boxLayout with the passed ri!label and ri!value from the primary interface.  I have these set to show only in lower environments, and only to system administrators.  Works great, you can even leave the code in up to production.  rule!isDev() and rule!isTest() check an environmental constant cons!SERVER, which holds DEV, TEST or PROD depending on the server.  rule!isDev() returns true for cons!SERVER="DEV", etc.

    On occasion for trickier debugging I'll put a section in that will show for system admins up to production, users report an issue, I can view their task with my debugging info right on the screen, which they cannot see.

    Something like:

    a!boxLayout(
      label: "DEBUG",
      style: "ERROR",
      showWhen: and(
        fn!isusersystemadministrator(loggedInUser()),
        or(
          rule!isDev(),
          rule!isTest()
        )
      ),
      contents: {
        a!paragraphField(
          label: ri!label,
          value: ri!value,
          readOnly: true
        )
      }
    )

Children