diff --git a/README.md b/README.md index 74ee007..c92d672 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,32 @@ chmod +x ./nvidia-clerk-linux ./nvidia-clerk-linux -region=REGION_CODE_HERE ``` +## Testing + +Testing is currenly only supported for the USA region but it should show you what the automated checkout will look like. + +### Windows +| :memo: | All commands should be executed inside of cmd.exe | +|---------------|:------------------------| +```Batchfile +./nvidia-clerk-windows.exe -region=USA -test +``` + +### Mac OSX +| :memo: | All commands should be executed inside of Terminal.app | +|---------------|:------------------------| +```shell +./nvidia-clerk-darwin -region=USA -test +``` + +### Linux +| :memo: | All commands should be executed inside of Shell | +|---------------|:------------------------| +```shell +./nvidia-clerk-linux -region=USA -test +``` + + # Advanced Usage ## SMS Notifications diff --git a/internal/config/config.go b/internal/config/config.go index 0bdc7fb..405726c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,6 +11,7 @@ type RegionalConfig struct { Locale string NvidiaLocale string Currency string + TestSKU string } type TwitterConfig struct { @@ -35,6 +36,7 @@ type Config struct { Locale string Currency string SKU string + TestSKU string TwilioConfig TwilioConfig TwitterConfig TwitterConfig DiscordConfig DiscordConfig @@ -95,6 +97,7 @@ var regionalConfig = map[string]RegionalConfig{ Locale: "en_us", NvidiaLocale: "en_us", Currency: "USD", + TestSKU: "5379432500", }, "GBR": { SKU: "5438792800", @@ -236,6 +239,7 @@ func GetConfig(region string, smsEnabled bool, discordEnabled bool, twitterEnabl configuration := Config{} configuration.SKU = regionConfig.SKU + configuration.TestSKU = regionConfig.TestSKU configuration.Locale = regionConfig.Locale configuration.Currency = regionConfig.Currency diff --git a/main.go b/main.go index 4b72dc7..74d96ff 100644 --- a/main.go +++ b/main.go @@ -66,6 +66,7 @@ func main() { // Execute Tests if *useTest == true { + config.SKU = config.TestSKU if *useSms == true { runTest("sms", httpClient, *config) } @@ -81,9 +82,6 @@ func main() { if testsHaveErrors == true { fmt.Printf("Testing failed with errors, exiting...\n") os.Exit(1) - } else { - fmt.Printf("Testing completed succesfully, exiting...\n") - os.Exit(0) } }