Skip to content

Commit

Permalink
feat(synthetics): Update device emulation test for Simple Browser mon…
Browse files Browse the repository at this point in the history
…itor synthetics (#1054)
  • Loading branch information
amolero-nr authored and sanderblue committed Aug 24, 2023
1 parent 93afc5c commit bc87cb6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/agentapplications/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var AgentApplicationBrowserLoaderTypes = struct {
SPA: "SPA",
}

// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatability and do not represent currently allowed values for new applications.
// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatibility and do not represent currently allowed values for new applications.
// See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) for further information.
type AgentApplicationSettingsBrowserLoader string

Expand All @@ -50,7 +50,7 @@ var AgentApplicationSettingsBrowserLoaderTypes = struct {
RUM AgentApplicationSettingsBrowserLoader
// Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications.
SPA AgentApplicationSettingsBrowserLoader
// This value is specified for backwards-compatability.
// This value is specified for backwards-compatibility.
XHR AgentApplicationSettingsBrowserLoader
}{
// Use PRO instead
Expand Down
4 changes: 2 additions & 2 deletions pkg/synthetics/synthetics_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions pkg/synthetics/synthetics_api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {
},
},
UseTlsValidation: &tv,
DeviceEmulation: &SyntheticsDeviceEmulationInput{
DeviceOrientation: SyntheticsDeviceOrientationTypes.PORTRAIT,
DeviceType: SyntheticsDeviceTypeTypes.MOBILE,
},
},
}

Expand All @@ -117,6 +121,11 @@ func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {
EnableScreenshotOnFailureAndScript: &tv,
ResponseValidationText: "Success",
UseTlsValidation: &tv,
// Test changing device emulation options
DeviceEmulation: &SyntheticsDeviceEmulationInput{
DeviceOrientation: SyntheticsDeviceOrientationTypes.LANDSCAPE,
DeviceType: SyntheticsDeviceTypeTypes.TABLET,
},
},
Locations: SyntheticsLocationsInput{
Public: []string{
Expand Down
4 changes: 4 additions & 0 deletions pkg/synthetics/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ var SyntheticsMonitorUpdateErrorTypeTypes = struct {
INTERNAL_SERVER_ERROR SyntheticsMonitorUpdateErrorType
// Monitor not found for given guid (monitor does not exist on account or has already been deleted)
NOT_FOUND SyntheticsMonitorUpdateErrorType
// Monitor update exceeds account subscription limits
PAYMENT_REQUIRED SyntheticsMonitorUpdateErrorType
// An error occurred while updating monitor script
SCRIPT_ERROR SyntheticsMonitorUpdateErrorType
// Monitor tags were not updated.
Expand All @@ -256,6 +258,8 @@ var SyntheticsMonitorUpdateErrorTypeTypes = struct {
INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR",
// Monitor not found for given guid (monitor does not exist on account or has already been deleted)
NOT_FOUND: "NOT_FOUND",
// Monitor update exceeds account subscription limits
PAYMENT_REQUIRED: "PAYMENT_REQUIRED",
// An error occurred while updating monitor script
SCRIPT_ERROR: "SCRIPT_ERROR",
// Monitor tags were not updated.
Expand Down

0 comments on commit bc87cb6

Please sign in to comment.