Skip to content

Commit b5f601b

Browse files
royjitlawmicha
andauthored
test: Move the test logic to use common configuration (#1480)
Co-authored-by: Michael Law <[email protected]>
1 parent 1e5d800 commit b5f601b

File tree

37 files changed

+103
-241
lines changed

37 files changed

+103
-241
lines changed

AmplifyPlugins/API/APICategoryPlugin.xcodeproj/project.pbxproj

Lines changed: 0 additions & 52 deletions
Large diffs are not rendered by default.

AmplifyPlugins/API/AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLModelBasedTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import XCTest
1414
// swiftlint:disable type_body_length
1515
class GraphQLModelBasedTests: XCTestCase {
1616

17-
static let amplifyConfiguration = "GraphQLModelBasedTests-amplifyconfiguration"
17+
static let amplifyConfiguration = "testconfiguration/GraphQLModelBasedTests-amplifyconfiguration"
1818

1919
override func setUp() {
2020
Amplify.reset()

AmplifyPlugins/API/AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ The following steps demonstrate how to set up a GraphQL endpoint with AppSync. T
55

66
### Set-up
77

8-
1. `amplify-init`
8+
1. `amplify init`
99

1010
2. `amplify add api`
1111

12-
1312
```perl
1413
? Please select from one of the below mentioned services: `GraphQL`
1514
? Provide API name: `<APIName>`
@@ -226,7 +225,8 @@ type Nested {
226225
valueTwo: String
227226
}
228227
229-
230228
```
231229

232230
3. `amplify push`
231+
232+
4. Copy `amplifyconfiguration.json` over as `GraphQLModelBasedTests-amplifyconfiguration.json` to `~/.aws-amplify/amplify-ios/testconfiguration/`

AmplifyPlugins/API/AWSAPICategoryPluginFunctionalTests/GraphQLSyncBased/GraphQLSyncBasedTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import AWSPluginsCore
1515
// swiftlint:disable type_body_length
1616
class GraphQLSyncBasedTests: XCTestCase {
1717

18-
static let amplifyConfiguration = "GraphQLSyncBasedTests-amplifyconfiguration"
18+
static let amplifyConfiguration = "testconfiguration/GraphQLSyncBasedTests-amplifyconfiguration"
1919

2020
override func setUp() {
2121
Amplify.reset()

AmplifyPlugins/API/AWSAPICategoryPluginFunctionalTests/GraphQLSyncBased/GraphQLSyncCustomPrimaryKeyTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import AWSPluginsCore
1414

1515
class GraphQLSyncCustomPrimaryKeyTests: XCTestCase {
1616

17-
static let amplifyConfiguration = "GraphQLSyncBasedTests-amplifyconfiguration"
17+
static let amplifyConfiguration = "testconfiguration/GraphQLSyncBasedTests-amplifyconfiguration"
1818

1919
override func setUp() {
2020
Amplify.reset()

AmplifyPlugins/API/AWSAPICategoryPluginFunctionalTests/GraphQLSyncBased/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ type CustomerOrder @model
5858
```
5959

6060
3. `amplify push`
61+
62+
4. Copy `amplifyconfiguration.json` over as `GraphQLSyncBasedTests-amplifyconfiguration.json` to `~/.aws-amplify/amplify-ios/testconfiguration/`

AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithIAMIntegrationTests/GraphQLWithIAMIntegrationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class GraphQLWithIAMIntegrationTests: XCTestCase {
2020
let password: String
2121
}
2222

23-
let amplifyConfigurationFile = "GraphQLWithIAMIntegrationTests-amplifyconfiguration"
24-
let credentialsFile = "GraphQLWithIAMIntegrationTests-credentials"
23+
let amplifyConfigurationFile = "testconfiguration/GraphQLWithIAMIntegrationTests-amplifyconfiguration"
24+
let credentialsFile = "testconfiguration/GraphQLWithIAMIntegrationTests-credentials"
2525
var user: User!
2626

2727
override func setUp() {

AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithIAMIntegrationTests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
2626

2727
4. `amplify push`
2828

29-
5. Copy `amplifyconfiguration.json` over as `GraphQLWithIAMIntegrationTests-amplifyconfiguration.json`
29+
5. Copy `amplifyconfiguration.json` over as `GraphQLWithIAMIntegrationTests-amplifyconfiguration.json` to `~/.aws-amplify/amplify-ios/testconfiguration/`
3030

3131
6. `amplify console auth` and choose `Identity Pool`. Click on **Edit Identity pool** and make note of IAM Role that is assigned for the Authenticated role.
3232

@@ -36,7 +36,7 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
3636

3737
9. Click on Attach Policies, choose **AWSAppSyncInvokeFullAccess**, and attach the policy. This will allow users that are signed into the app to have access to invoke AppSync APIs.
3838

39-
10. Create `GraphQLWithIAMIntegrationTests-credentials.json` with a json object containing `username`, and `password`, used to create the cognito user in the userpool.
39+
10. Create `GraphQLWithIAMIntegrationTests-credentials.json` inside `~/.aws-amplify/amplify-ios/testconfiguration/` with a json object containing `username`, and `password`, used to create the cognito user in the userpool.
4040

4141
```json
4242
{

AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithLambdaAuthIntegrationTests/GraphQLWithLambdaAuthIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import AmplifyPlugins
1414
@testable import AWSAPICategoryPluginTestCommon
1515

1616
class GraphQLWithLambdaAuthIntegrationTests: XCTestCase {
17-
let amplifyConfigurationFile = "GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration"
17+
let amplifyConfigurationFile = "testconfiguration/GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration"
1818
override func setUp() {
1919
do {
2020
try Amplify.add(plugin: AWSAPIPlugin(apiAuthProviderFactory: TestAPIAuthProviderFactory()))

AmplifyPlugins/API/AWSAPICategoryPluginIntegrationTests/GraphQL/GraphQLWithLambdaAuthIntegrationTests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following steps demonstrate how to set up an GraphQL endpoint with AppSync.
1919

2020
3. `amplify push`
2121

22-
4. Copy `amplifyconfiguration.json` over as `GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration.json`
22+
4. Copy `amplifyconfiguration.json` over as `GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration.json` inside `~/.aws-amplify/amplify-ios/testconfiguration/`
2323
5. Replace the authorization type `API_KEY` with `AWS_LAMBDA` in `GraphQLWithLambdaAuthIntegrationTests-amplifyconfiguration.json`
2424

2525
6. Run `amplify console` to open the AWS Console

0 commit comments

Comments
 (0)