Skip to content

Commit e94114d

Browse files
committed
Add test for programatic rejectAll function
1 parent f92384e commit e94114d

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

UI-TESTS/UITests.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,35 @@ public void AcceptRejectAllUsnatInPMTest()
407407
Assert.That(true, Is.True);
408408
}
409409

410+
[Test]
411+
public void ProgramaticRejectAllGDPRTest()
412+
{
413+
Console.WriteLine(">>>ProgramaticRejectAllGDPRTest");
414+
if (driver == null)
415+
{
416+
Assert.Fail("Driver has not been initialized.");
417+
}
418+
419+
string firstLayerContext = pages.preFirstLayer.SelectFirstLayer();
420+
421+
pages.firstLayerGO(true, true, true);
422+
pages.nativeAppLayer.waitForSdkDone();
423+
424+
Console.WriteLine($"Try to get: nativeAppLayer.getConsentValueText");
425+
var data = pages.nativeAppLayer.getConsentValueText();
426+
Console.WriteLine($"ConsentValueText: {data}");
427+
428+
Console.WriteLine("Call 'rejectAll' with campaign GDPR");
429+
altDriver.CallStaticMethod<int>("ConsentManagementProvider.CMP", "ConcreteInstance.RejectAll", "Assembly-CSharp", new object[] { 0 });
430+
System.Threading.Thread.Sleep(2000);
431+
432+
Console.WriteLine($"Try to get: nativeAppLayer.getConsentValueText");
433+
var dataNew = pages.nativeAppLayer.getConsentValueText();
434+
Console.WriteLine($"ConsentValueText: {dataNew}");
435+
436+
Assert.That(data!=dataNew, Is.True);
437+
}
438+
410439
[TearDown]
411440
public void Teardown()
412441
{

UI-TESTS/startup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ runTest android.runsettings ClearAllButtonTest
5050
sleep 5
5151
runTest android.runsettings AuthIdTest
5252
sleep 5
53-
runTest android.runsettings AcceptRejectAllUsnatTest
53+
runTest android.runsettings AcceptRejectAllUsnatInPMTest
54+
sleep 5
55+
runTest android.runsettings ProgramaticRejectAllGDPRTest
5456

5557
#Kill android emulator
5658
osascript -e 'tell app "Terminal" to close window id '${androidEmulator_window_id}''

0 commit comments

Comments
 (0)