diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 38c850555..a37c3bfb6 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -10,13 +10,13 @@ defaults: working-directory: Example jobs: lint: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - - name: linting - run: swiftlint lint + - run: brew install swiftlint + - run: swiftlint lint BuildSwiftPackage: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app @@ -28,14 +28,14 @@ jobs: with: path: /Users/runner/Library/Developer/Xcode/DerivedData/**/*.xcresult BuildCarthageProject: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app - name: Building Carthage Project run: cd ./SPCarthageTest && ./build.sh ObjC-ExampleApp-tests: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app @@ -47,7 +47,7 @@ jobs: with: path: /Users/runner/Library/Developer/Xcode/DerivedData/**/*.xcresult ConsentViewController: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app @@ -59,7 +59,7 @@ jobs: with: path: /Users/runner/Library/Developer/Xcode/DerivedData/**/*.xcresult AuthExample-tests: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app @@ -71,7 +71,7 @@ jobs: with: path: /Users/runner/Library/Developer/Xcode/DerivedData/**/*.xcresult NativePMExampleApp: - runs-on: macos-latest-large + runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: sudo xcode-select -s /Applications/Xcode_15.3.app diff --git a/ConsentViewController/Classes/SourcePointClient/SourcePointClient.swift b/ConsentViewController/Classes/SourcePointClient/SourcePointClient.swift index 2c13515e5..a47d60a36 100644 --- a/ConsentViewController/Classes/SourcePointClient/SourcePointClient.swift +++ b/ConsentViewController/Classes/SourcePointClient/SourcePointClient.swift @@ -219,7 +219,7 @@ class SourcePointClient: SourcePointProtocol { "consentLanguage": consentLanguage.rawValue, "propertyId": propertyId, "messageId": messageId, - "includeData": "{\"categories\": {\"type\": \"RecordString\"}}" + "includeData": "{\"categories\":{\"type\":\"RecordString\"},\"translateMessage\":true}" ])! // swiftlint:disable:this force_unwrapping client.get(urlString: url.absoluteString, apiCode: .GDPR_MESSAGE) { Self.parseResponse($0, InvalidResponseMessageGDPREndpointError()) { (parsingResult: Result) in @@ -238,7 +238,8 @@ class SourcePointClient: SourcePointProtocol { "env": Constants.Urls.envParam, "consentLanguage": consentLanguage.rawValue, "propertyId": propertyId, - "messageId": messageId + "messageId": messageId, + "includeData": "{\"translateMessage\":true}" ])! // swiftlint:disable:this force_unwrapping client.get(urlString: url.absoluteString, apiCode: .CCPA_MESSAGE) { Self.parseResponse($0, InvalidResponseMessageCCPAEndpointError()) { (parsingResult: Result) in diff --git a/Example/NativePMExampleAppUITests/NativePMUITests.swift b/Example/NativePMExampleAppUITests/NativePMUITests.swift index 3997bf595..33280adce 100644 --- a/Example/NativePMExampleAppUITests/NativePMUITests.swift +++ b/Example/NativePMExampleAppUITests/NativePMUITests.swift @@ -158,7 +158,7 @@ class NativePMUITests: QuickSpec { expect(self.app.ccpaMessage.doNotSellMyInfoButton.staticTexts["OFF"]).toEventually(showUp()) } - it("Handles message translation") { + it("Handles message translation via 1st layer") { self.app.relaunch(clean: true, language: .Spanish) // Message content is translated @@ -167,6 +167,19 @@ class NativePMUITests: QuickSpec { // as well as categories expect(self.app.gdprMessage.categoriesList.staticTexts["Crear perfiles para publicidad personalizada"].exists).toEventually(beTrue()) } + + it("Handles message translation when loading PM via function") { + self.app.relaunch(clean: true, gdpr: true, ccpa: false, language: .Spanish) + + self.waitFor(self.app.gdprMessage) + self.remote.press(.select) + + self.app.gdprPrivacyManagerButton.remotePress() + self.waitFor(self.app.gdprMessage) + + expect(self.app.gdprMessage.headerTitle).toEventually(containText("Mensage GDPR")) + expect(self.app.gdprMessage.categoriesList.staticTexts["Crear perfiles para publicidad personalizada"].exists).toEventually(beTrue()) + } it("Manage Preferences and Our Vendors through GDPR Privacy Manager with few consent purposes ON") { self.app.relaunch(clean: true, gdpr: true, ccpa: false) @@ -242,145 +255,5 @@ class NativePMUITests: QuickSpec { self.remote.press(.right) self.checkForAllVendors(on: self.app.gdprMessage, shouldBe: "On", totalVendors: self.gdprDefaultOnCategories) } - -// it("Save and Exit through CCPA & GDPR Privacy Manager") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// self.app.homeButton.expectToHaveFocus() -// self.app.saveAndExitInternalButton.remotePress() -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// self.app.homeButton.expectToHaveFocus() -// self.app.saveAndExitInternalButton.remotePress() -// } -// -// it("Privacy policy of CCPA & GDPR Privacy Manager") { -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.privacyPolicyButton.remotePress() -// self.app.pressHomeAndReturnToHomeViewWithFocusOnPrivacyPolicyButton() -// self.app.acceptButton.remotePress() -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.privacyPolicyButton.remotePress() -// self.app.pressHomeAndReturnToHomeViewWithFocusOnPrivacyPolicyButton() -// self.app.acceptButton.remotePress() -// } -// -// it("Manage Preferences through CCPA & GDPR Privacy Manager with few purposes ON") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.storeAndAccessInformation) -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.storeAndAccessInformation) -// self.app.pressSaveAndExitInCategory() -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.category) -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.category2) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Manage Preferences through CCPA & GDPR Privacy Manager with few purposes OFF") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.storeAndAccessInformation) -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.storeAndAccessInformation) -// self.app.pressSaveAndExitInCategory() -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.category) -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.category2) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Our Partners through CCPA & GDPR Privacy Manager with few purposes On") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.loopMe) -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.googleCharts) -// self.app.pressSaveAndExitInCategory() -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.freewheel) -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.seedtag) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Our Partners through CCPA & GDPR Privacy Manager with few purposes OFF") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.loopMe) -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.googleCharts) -// self.app.pressSaveAndExitInCategory() -// self.app.ccpaPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.pressCategory(element: self.app.freewheel) -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.seedtag) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Manage Preferences through GDPR Privacy Manager with few Legitimate interest purposes ON") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.switchToLegitInterests() -// self.app.pressCategory(element: self.app.createPersonalisedAdsProfile) -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.createPersonalisedAdsProfile) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Manage Preferences through GDPR Privacy Manager with few Legitimate interest purposes OFF") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.managePreferencesButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.switchToLegitInterests() -// self.app.pressCategory(element: self.app.createPersonalisedAdsProfile) -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.createPersonalisedAdsProfile) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Our Partners through GDPR Privacy Manager with few Legitimate interest purposes ON") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.switchToLegitInterests() -// self.app.pressCategory(element: self.app.loopMe) -// self.app.backButton.expectToHaveFocus() -// self.app.pressOnButtonInCategoryDetails(elementToEnsure: self.app.loopMe) -// self.app.pressSaveAndExitInCategory() -// } -// -// it("Our Partners through GDPR Privacy Manager with few Legitimate interest purposes Off") { -// self.app.gdprPrivacyManagerButton.remotePress() -// self.app.acceptButton.expectToHaveFocus() -// self.app.ourPartnersButton.remotePress() -// expect(self.app.homeButton).toEventually(showUp()) -// self.app.switchToLegitInterests() -// self.app.pressCategory(element: self.app.loopMe) -// self.app.backButton.expectToHaveFocus() -// self.app.pressOffButtonInCategoryDetails(elementToEnsure: self.app.loopMe) -// self.app.pressSaveAndExitInCategory() -// } } }