From ac4b9d1f2ed523f1bcc58be22e2f4b680d205c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Thu, 23 May 2024 10:26:19 +0200 Subject: [PATCH 01/43] Added Compatibility UITests (ported to Appium) to TestCases project --- .../Tests/Issues/Bugzilla23942.cs | 24 ++++ .../Tests/Issues/Bugzilla25943.cs | 37 +++++ .../Tests/Issues/Bugzilla28570.cs | 31 +++++ .../Tests/Issues/Bugzilla29128.cs | 25 ++++ .../Tests/Issues/Bugzilla29363.cs | 30 ++++ .../Tests/Issues/Bugzilla29453.cs | 39 ++++++ .../Tests/Issues/Bugzilla30166.cs | 35 +++++ .../Tests/Issues/Bugzilla30935.cs | 24 ++++ .../Tests/Issues/Bugzilla31255.cs | 30 ++++ .../Tests/Issues/Bugzilla31366.cs | 42 ++++++ .../Tests/Issues/Bugzilla31395.cs | 32 +++++ .../Tests/Issues/Bugzilla31688.cs | 28 ++++ .../Tests/Issues/Bugzilla32206.cs | 45 ++++++ .../Tests/Issues/Bugzilla32615.cs | 28 ++++ .../Tests/Issues/Bugzilla32830.cs | 35 +++++ .../Tests/Issues/Bugzilla32898.cs | 29 ++++ .../Tests/Issues/Bugzilla34007.cs | 44 ++++++ .../Tests/Issues/Bugzilla34061.cs | 31 +++++ .../Tests/Issues/Bugzilla35472.cs | 40 ++++++ .../Tests/Issues/Bugzilla35477.cs | 29 ++++ .../Tests/Issues/Bugzilla35733.cs | 28 ++++ .../Tests/Issues/Bugzilla35736.cs | 30 ++++ .../Tests/Issues/Bugzilla36009.cs | 27 ++++ .../Tests/Issues/Bugzilla36559.cs | 28 ++++ .../Tests/Issues/Bugzilla36703.cs | 34 +++++ .../Tests/Issues/Bugzilla36780.cs | 34 +++++ .../Tests/Issues/Bugzilla36788.cs | 27 ++++ .../Tests/Issues/Bugzilla36802.cs | 25 ++++ .../Tests/Issues/Bugzilla37625.cs | 23 +++ .../Tests/Issues/Bugzilla38723.cs | 27 ++++ .../Tests/Issues/Bugzilla38989.cs | 26 ++++ .../Tests/Issues/Bugzilla39489.cs | 40 ++++++ .../Tests/Issues/Bugzilla39636.cs | 25 ++++ .../Tests/Issues/Bugzilla39668.cs | 24 ++++ .../Tests/Issues/Bugzilla39702.cs | 32 +++++ .../Tests/Issues/Bugzilla39821.cs | 25 ++++ .../Tests/Issues/Bugzilla40005.cs | 37 +++++ .../Tests/Issues/Bugzilla41205.cs | 26 ++++ .../Tests/Issues/Bugzilla41600.cs | 36 +++++ .../Tests/Issues/Bugzilla41619.cs | 26 ++++ .../Tests/Issues/Bugzilla41842.cs | 28 ++++ .../Tests/Issues/Bugzilla42277.cs | 37 +++++ .../Tests/Issues/Bugzilla42956.cs | 30 ++++ .../Tests/Issues/Bugzilla43519.cs | 34 +++++ .../Tests/Issues/Bugzilla44096.cs | 104 ++++++++++++++ .../Tests/Issues/Bugzilla44176.cs | 80 +++++++++++ .../Tests/Issues/Bugzilla44476.cs | 26 ++++ .../Tests/Issues/Bugzilla45702.cs | 33 +++++ .../Tests/Issues/Bugzilla45722.cs | 37 +++++ .../Tests/Issues/Bugzilla46458.cs | 43 ++++++ .../Tests/Issues/Bugzilla49069.cs | 24 ++++ .../Tests/Issues/Bugzilla51238.cs | 27 ++++ .../Tests/Issues/Bugzilla51503.cs | 34 +++++ .../Tests/Issues/Bugzilla51505.cs | 29 ++++ .../Tests/Issues/Bugzilla52533.cs | 26 ++++ .../Tests/Issues/Bugzilla53179.cs | 40 ++++++ .../Tests/Issues/Bugzilla53445.cs | 39 ++++++ .../Tests/Issues/Bugzilla53834.cs | 27 ++++ .../Tests/Issues/Bugzilla55365.cs | 27 ++++ .../Tests/Issues/Bugzilla55745.cs | 28 ++++ .../Tests/Issues/Bugzilla55912.cs | 42 ++++++ .../Tests/Issues/Bugzilla56298.cs | 28 ++++ .../Tests/Issues/Bugzilla56771.cs | 31 +++++ .../Tests/Issues/Bugzilla56896.cs | 35 +++++ .../Tests/Issues/Bugzilla57114.cs | 34 +++++ .../Tests/Issues/Bugzilla57674.cs | 28 ++++ .../Tests/Issues/Bugzilla57758.cs | 27 ++++ .../Tests/Issues/Bugzilla57910.cs | 40 ++++++ .../Tests/Issues/Bugzilla58645.cs | 27 ++++ .../Tests/Issues/Bugzilla59097.cs | 27 ++++ .../Tests/Issues/Bugzilla59172.cs | 55 ++++++++ .../Tests/Issues/Bugzilla59896.cs | 27 ++++ .../Tests/Issues/Bugzilla59925.cs | 37 +++++ .../Tests/Issues/Bugzilla60123.cs | 26 ++++ .../Tests/Issues/GitHub1567.cs | 26 ++++ .../Tests/Issues/GitHub1648.cs | 28 ++++ .../Tests/Issues/Github1625.cs | 29 ++++ .../Tests/Issues/Github6384.cs | 34 +++++ .../Tests/Issues/Issue10182.cs | 25 ++++ .../Tests/Issues/Issue10222.cs | 30 ++++ .../Tests/Issues/Issue1023.cs | 41 ++++++ .../Tests/Issues/Issue10454.cs | 26 ++++ .../Tests/Issues/Issue10563.cs | 51 +++++++ .../Tests/Issues/Issue10744.cs | 23 +++ .../Tests/Issues/Issue11132.cs | 32 +++++ .../Tests/Issues/Issue11209.cs | 32 +++++ .../Tests/Issues/Issue11311.cs | 31 +++++ .../Tests/Issues/Issue11333.cs | 33 +++++ .../Tests/Issues/Issue1146.cs | 26 ++++ .../Tests/Issues/Issue11769.cs | 67 +++++++++ .../Tests/Issues/Issue11853.cs | 34 +++++ .../Tests/Issues/Issue11962.cs | 29 ++++ .../Tests/Issues/Issue11969.cs | 37 +++++ .../Tests/Issues/Issue12060.cs | 26 ++++ .../Tests/Issues/Issue12079.cs | 32 +++++ .../Tests/Issues/Issue12134.cs | 29 ++++ .../Tests/Issues/Issue12153.cs | 24 ++++ .../Tests/Issues/Issue1219.cs | 26 ++++ .../Tests/Issues/Issue12193.cs | 43 ++++++ .../Tests/Issues/Issue12246.cs | 39 ++++++ .../Tests/Issues/Issue1236.cs | 25 ++++ .../Tests/Issues/Issue12374.cs | 28 ++++ .../Tests/Issues/Issue12484.cs | 26 ++++ .../Tests/Issues/Issue12642.cs | 30 ++++ .../Tests/Issues/Issue1267.cs | 26 ++++ .../Tests/Issues/Issue12714.cs | 29 ++++ .../Tests/Issues/Issue12777.cs | 27 ++++ .../Tests/Issues/Issue12848.cs | 34 +++++ .../Tests/Issues/Issue13126_2.cs | 25 ++++ .../Tests/Issues/Issue13203.cs | 26 ++++ .../Tests/Issues/Issue13390.cs | 27 ++++ .../Tests/Issues/Issue13436.cs | 25 ++++ .../Tests/Issues/Issue13476.cs | 33 +++++ .../Tests/Issues/Issue1355.cs | 29 ++++ .../Tests/Issues/Issue13551.cs | 29 ++++ .../Tests/Issues/Issue13616.cs | 27 ++++ .../Tests/Issues/Issue13916.cs | 29 ++++ .../Tests/Issues/Issue1426.cs | 33 +++++ .../Tests/Issues/Issue1436.cs | 27 ++++ .../Tests/Issues/Issue1469.cs | 30 ++++ .../Tests/Issues/Issue1538.cs | 27 ++++ .../Tests/Issues/Issue1583.cs | 26 ++++ .../Tests/Issues/Issue1583_1.cs | 34 +++++ .../Tests/Issues/Issue1590.cs | 26 ++++ .../Tests/Issues/Issue1601.cs | 30 ++++ .../Tests/Issues/Issue1667.cs | 58 ++++++++ .../Tests/Issues/Issue1683.cs | 30 ++++ .../Tests/Issues/Issue1685.cs | 30 ++++ .../Tests/Issues/Issue1700.cs | 38 +++++ .../Tests/Issues/Issue1733.cs | 131 ++++++++++++++++++ .../Tests/Issues/Issue1747.cs | 38 +++++ .../Tests/Issues/Issue1769.cs | 38 +++++ .../Tests/Issues/Issue1799.cs | 34 +++++ .../Tests/Issues/Issue181.cs | 24 ++++ .../Tests/Issues/Issue1851.cs | 30 ++++ .../Tests/Issues/Issue1900.cs | 26 ++++ .../Tests/Issues/Issue1905.cs | 33 +++++ .../Tests/Issues/Issue1908.cs | 26 ++++ .../Tests/Issues/Issue1909.cs | 25 ++++ .../Tests/Issues/Issue1931.cs | 36 +++++ .../Tests/Issues/Issue1937.cs | 39 ++++++ .../Tests/Issues/Issue1942.cs | 28 ++++ .../Tests/Issues/Issue1975.cs | 36 +++++ .../Tests/Issues/Issue2004.cs | 25 ++++ .../Tests/Issues/Issue2035.cs | 29 ++++ .../Tests/Issues/Issue2222.cs | 26 ++++ .../Tests/Issues/Issue2241.cs | 33 +++++ .../Tests/Issues/Issue2259.cs | 31 +++++ .../Tests/Issues/Issue2339.cs | 33 +++++ .../Tests/Issues/Issue2354.cs | 28 ++++ .../Tests/Issues/Issue2399.cs | 34 +++++ .../Tests/Issues/Issue24574.cs | 31 +++++ .../Tests/Issues/Issue2482.cs | 30 ++++ .../Tests/Issues/Issue2617.cs | 28 ++++ .../Tests/Issues/Issue2653.cs | 33 +++++ .../Tests/Issues/Issue2674.cs | 25 ++++ .../Tests/Issues/Issue2680ScrollView.cs | 45 ++++++ .../Tests/Issues/Issue2681.cs | 29 ++++ .../Tests/Issues/Issue2728.cs | 29 ++++ .../Tests/Issues/Issue2775.cs | 26 ++++ .../Tests/Issues/Issue2777.cs | 24 ++++ .../Tests/Issues/Issue2829.cs | 36 +++++ .../Tests/Issues/Issue2837.cs | 26 ++++ .../Tests/Issues/Issue2842.cs | 28 ++++ .../Tests/Issues/Issue2858.cs | 36 +++++ .../Tests/Issues/Issue2929.cs | 45 ++++++ .../Tests/Issues/Issue2963.cs | 31 +++++ .../Tests/Issues/Issue2983.cs | 24 ++++ .../Tests/Issues/Issue3000.cs | 27 ++++ .../Tests/Issues/Issue3001.cs | 30 ++++ .../Tests/Issues/Issue3049.cs | 45 ++++++ .../Tests/Issues/Issue3087.cs | 25 ++++ .../Tests/Issues/Issue3089.cs | 32 +++++ .../Tests/Issues/Issue3262.cs | 109 +++++++++++++++ .../Tests/Issues/Issue3273.cs | 27 ++++ .../Tests/Issues/Issue3275.cs | 35 +++++ .../Tests/Issues/Issue3333.cs | 30 ++++ .../Tests/Issues/Issue3342.cs | 25 ++++ .../Tests/Issues/Issue3385.cs | 28 ++++ .../Tests/Issues/Issue3390.cs | 25 ++++ .../Tests/Issues/Issue3413.cs | 29 ++++ .../Tests/Issues/Issue342.cs | 48 +++++++ .../Tests/Issues/Issue3507.cs | 29 ++++ .../Tests/Issues/Issue3548.cs | 27 ++++ .../Tests/Issues/Issue3667.cs | 34 +++++ .../Tests/Issues/Issue3884.cs | 27 ++++ .../Tests/Issues/Issue417.cs | 44 ++++++ .../Tests/Issues/Issue4484.cs | 36 +++++ .../Tests/Issues/Issue4600.cs | 29 ++++ .../Tests/Issues/Issue465.cs | 29 ++++ .../Tests/Issues/Issue4782.cs | 27 ++++ .../Tests/Issues/Issue4879.cs | 24 ++++ .../Tests/Issues/Issue488.cs | 30 ++++ .../Tests/Issues/Issue5239.cs | 28 ++++ .../Tests/Issues/Issue5367.cs | 29 ++++ .../Tests/Issues/Issue5376.cs | 25 ++++ .../Tests/Issues/Issue5461.cs | 27 ++++ .../Tests/Issues/Issue5535.cs | 36 +++++ .../Tests/Issues/Issue5765.cs | 28 ++++ .../Tests/Issues/Issue5830.cs | 27 ++++ .../Tests/Issues/Issue5951.cs | 28 ++++ .../Tests/Issues/Issue6260.cs | 29 ++++ .../Tests/Issues/Issue6262.cs | 35 +++++ .../Tests/Issues/Issue6368.cs | 30 ++++ .../Tests/Issues/Issue6458.cs | 34 +++++ .../Tests/Issues/Issue6472.cs | 40 ++++++ .../Tests/Issues/Issue6705.cs | 31 +++++ .../Tests/Issues/Issue6932.cs | 53 +++++++ .../Tests/Issues/Issue6945.cs | 35 +++++ .../Tests/Issues/Issue6963.cs | 25 ++++ .../Tests/Issues/Issue6994.cs | 29 ++++ .../Tests/Issues/Issue7102.cs | 35 +++++ .../Tests/Issues/Issue7313.cs | 28 ++++ .../Tests/Issues/Issue7338.cs | 29 ++++ .../Tests/Issues/Issue7371.cs | 27 ++++ .../Tests/Issues/Issue7393.cs | 27 ++++ .../Tests/Issues/Issue7534.cs | 29 ++++ .../Tests/Issues/Issue773.cs | 41 ++++++ .../Tests/Issues/Issue8004.cs | 42 ++++++ .../Tests/Issues/Issue8167.cs | 29 ++++ .../Tests/Issues/Issue8262.cs | 34 +++++ .../Tests/Issues/Issue8263.cs | 31 +++++ .../Tests/Issues/Issue852.cs | 41 ++++++ .../Tests/Issues/Issue8529.cs | 35 +++++ .../Tests/Issues/Issue8715.cs | 35 +++++ .../Tests/Issues/Issue8766.cs | 24 ++++ .../Tests/Issues/Issue8801.cs | 28 ++++ .../Tests/Issues/Issue8814.cs | 30 ++++ .../Tests/Issues/Issue8870.cs | 49 +++++++ .../Tests/Issues/Issue8899.cs | 31 +++++ .../Tests/Issues/Issue9006.cs | 31 +++++ .../Tests/Issues/Issue9087.cs | 27 ++++ .../Tests/Issues/Issue9196.cs | 28 ++++ .../Tests/Issues/Issue9306.cs | 41 ++++++ .../Tests/Issues/Issue935.cs | 30 ++++ .../Tests/Issues/Issue9355.cs | 28 ++++ .../Tests/Issues/Issue9419.cs | 27 ++++ .../Tests/Issues/Issue9580.cs | 30 ++++ .../Tests/Issues/Issue968.cs | 33 +++++ .../Tests/Issues/Issue9794.cs | 36 +++++ .../Tests/Issues/Issue9929.cs | 35 +++++ .../Tests/Issues/Issue9951.cs | 38 +++++ .../UITestCategories.cs | 1 + .../UITestIgnoreAttributes.cs | 102 ++++++++++++++ 244 files changed, 8013 insertions(+) create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla23942.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla25943.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla28570.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29128.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29363.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29453.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30166.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30935.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31255.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31366.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31395.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31688.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32206.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32615.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32830.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32898.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34007.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34061.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35472.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35477.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35733.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35736.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36009.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36559.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36703.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36780.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36788.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36802.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla37625.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38723.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38989.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39489.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39636.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39668.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39702.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39821.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla40005.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41205.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41600.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41619.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41842.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42277.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42956.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla43519.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44096.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44176.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44476.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45702.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45722.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla46458.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla49069.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51238.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51503.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51505.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla52533.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53179.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53445.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53834.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55365.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55745.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55912.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56298.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56771.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56896.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57114.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57674.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57758.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57910.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla58645.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59097.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59172.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59896.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59925.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla60123.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1567.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1648.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github1625.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github6384.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10182.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1023.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10454.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10744.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11132.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11209.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11311.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11333.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1146.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11769.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11853.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11962.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11969.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12060.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12079.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12134.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12153.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1219.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12193.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12246.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1236.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12374.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12484.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1267.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12714.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12777.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12848.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13126_2.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13203.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13390.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13436.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1355.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13551.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13616.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13916.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1426.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1436.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1469.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1538.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583_1.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1590.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1601.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1667.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1683.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1685.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1700.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1733.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1747.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1769.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1799.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue181.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1851.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1900.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1905.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1908.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1909.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1931.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1937.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1942.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1975.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2004.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2035.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2222.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2241.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2259.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2339.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2354.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2399.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24574.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2482.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2617.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2653.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2674.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2680ScrollView.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2681.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2728.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2775.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2777.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2829.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2837.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2842.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2858.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2929.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2963.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2983.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3000.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3001.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3049.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3087.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3089.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3262.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3273.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3275.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3333.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3342.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3385.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3390.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3413.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue342.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3507.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3548.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3667.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3884.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue417.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4484.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4600.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue465.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4782.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4879.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue488.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5239.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5367.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5376.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5461.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5535.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5765.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5830.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5951.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6260.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6262.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6368.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6458.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6472.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6705.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6932.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6945.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6963.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6994.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7102.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7313.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7338.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7371.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7393.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7534.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue773.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8004.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8167.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8262.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8263.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue852.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8715.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8766.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8801.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8814.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8870.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8899.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9006.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9087.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9196.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9306.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue935.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9355.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9419.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9580.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue968.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9929.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9951.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla23942.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla23942.cs new file mode 100644 index 000000000000..ba3d45e3e0a2 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla23942.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla23942 : _IssuesUITest + { + public Bugzilla23942(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Cannot bind properties in BindableObjects added to static resources in XAML"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla23942Test() + { + App.WaitForNoElement("success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla25943.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla25943.cs new file mode 100644 index 000000000000..e2f0b1cdcc36 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla25943.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla25943 : _IssuesUITest + { + public Bugzilla25943(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] TapGestureRecognizer does not work with a nested StackLayout"; + + /* + const string InnerLayout = "innerlayout"; + const string OuterLayout = "outerlayout"; + const string Success = "Success"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void VerifyNestedStacklayoutTapsBubble() + { + App.WaitForElement(InnerLayout); + App.Tap(InnerLayout); + + App.WaitForElement(OuterLayout); + App.Tap(OuterLayout); + + App.WaitForNoElement(Success); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla28570.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla28570.cs new file mode 100644 index 000000000000..7db73475a91c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla28570.cs @@ -0,0 +1,31 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla28570 : _IssuesUITest + { + public Bugzilla28570(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "https://bugzilla.xamarin.com/show_bug.cgi?id=28570"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid("Scroll to end not working.")] + public void Bugzilla28570Test() + { + App.WaitForElement("Tap"); + App.Screenshot("At test page"); + App.Tap("Tap"); + + App.WaitForElement("28570Target"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29128.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29128.cs new file mode 100644 index 000000000000..ab75f3d75bb7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29128.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla29128 : _IssuesUITest + { + public Bugzilla29128(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Slider background lays out wrong Android"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla29128Test() + { + App.WaitForElement("SliderId"); + App.Screenshot("Slider and button should be centered"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29363.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29363.cs new file mode 100644 index 000000000000..46bf7af09775 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29363.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla29363 : _IssuesUITest + { + public Bugzilla29363(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "PushModal followed immediate by PopModal crashes"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void PushButton() + { + App.WaitForElement("ModalPushPopTest"); + App.Tap("ModalPushPopTest"); + Thread.Sleep(2000); + + // if it didn't crash, yay + App.WaitForElement("ModalPushPopTest"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29453.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29453.cs new file mode 100644 index 000000000000..5d97a8d21c7c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla29453.cs @@ -0,0 +1,39 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla29453 : _IssuesUITest + { + public Bugzilla29453(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Navigation.PopAsync(false) in Entry.Completed handler => System.ArgumentException"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla29453Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("I am at Issue Bugzilla29453"); + App.WaitForElement("Page1"); + App.Tap("btnGotoPage2"); + App.Tap("entryText"); + App.EnterText("entryText", "XF"); + + App.DismissKeyboard(); + App.Back(); + + // TODO: Implement PressEnter method. + //App.PressEnter(); + //App.WaitForElement("Page1"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30166.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30166.cs new file mode 100644 index 000000000000..ac19b514a3a1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30166.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla30166 : _IssuesUITest + { + public Bugzilla30166(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NavigationBar.BarBackgroundColor resets on Lollipop after popping modal page"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void Issue10222Test() + { + try + { + App.WaitForElement("PushModal"); + App.Tap("PushModal"); + App.WaitForElement("Back"); + App.Tap("Back"); + App.Screenshot("Navigation bar should be red"); + } + finally + { + App.Back(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30935.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30935.cs new file mode 100644 index 000000000000..76292712e80b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla30935.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla30935 : _IssuesUITest + { + public Bugzilla30935(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NullReferenceException in ViewRenderer (Microsoft.Maui.Controls.Platform.Android)"; + + [Test] + [Category(UITestCategories.Page)] + [Category(UITestCategories.Compatibility)] + public void Bugzilla30935DoesntThrowException() + { + App.WaitForNoElement("IssuePageLabel"); + App.WaitForNoElement("entry"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31255.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31255.cs new file mode 100644 index 000000000000..1bd54232db78 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31255.cs @@ -0,0 +1,30 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla31255 : _IssuesUITest + { + public Bugzilla31255(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Flyout's page Icon cause memory leak after FlyoutPage is popped out by holding on page"; + public override bool ResetMainPage => false; + + [Test] + [Ignore("The sample is crashing.")] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [IgnoredDuringMoveToAppium("The sample is crashing. More information: https://github.com/dotnet/maui/issues/21206")] + public async Task Bugzilla31255Test() + { + App.Screenshot("I am at Bugzilla 31255"); + await Task.Delay(5000); + App.WaitForNoElement("Page1. But Page2 IsAlive = False"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31366.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31366.cs new file mode 100644 index 000000000000..aa014731f2b8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31366.cs @@ -0,0 +1,42 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla31366 : _IssuesUITest + { + public Bugzilla31366(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Pushing and then popping a page modally causes ArgumentOutOfRangeException"; + public override bool ResetMainPage => false; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + Reset(); + } + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue31366PushingAndPoppingModallyCausesArgumentOutOfRangeException() + { + App.Tap("StartPopOnAppearingTest"); + App.WaitForNoElement("If this is visible, the PopOnAppearing test has passed."); + } + + [Test] + [Category(UITestCategories.Navigation)] + [FailsOnIOS] + public void Issue31366PushingWithModalStackCausesIncorrectStackOrder() + { + App.Tap("StartModalStackTest"); + App.WaitForNoElement("If this is visible, the modal stack test has passed."); + App.Back(); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31395.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31395.cs new file mode 100644 index 000000000000..14a10cf3f1f4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31395.cs @@ -0,0 +1,32 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla31395 : _IssuesUITest + { + public Bugzilla31395(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Crash when switching MainPage and using a Custom Render"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla31395Test() + { + App.WaitForElement("SwitchMainPage"); + Assert.DoesNotThrow(() => + { + App.Tap("SwitchMainPage"); + }); + App.WaitForNoElement("Hello"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31688.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31688.cs new file mode 100644 index 000000000000..df2fb790dfcb --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla31688.cs @@ -0,0 +1,28 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla31688 : _IssuesUITest + { + public Bugzilla31688(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla31688Test() + { + App.WaitForNoElement("Page3"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32206.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32206.cs new file mode 100644 index 000000000000..6dc74f2e2474 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32206.cs @@ -0,0 +1,45 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla32206 : _IssuesUITest + { + public Bugzilla32206(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ContextActions cause memory leak: Page is never destroyed"; + + [Test] + [Category(UITestCategories.Page)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla32206Test() + { + try + { + for (var n = 0; n < 10; n++) + { + App.WaitForElement("Push"); + App.Tap("Push"); + + App.WaitForElement("ListView"); + App.Back(); + } + + // At this point, the counter can be any value, but it's most likely not zero. + // Invoking GC once is enough to clean up all garbage data and set counter to zero + App.WaitForElement("GC"); + App.Tap("GC"); + + App.WaitForNoElement("Counter: 0"); + } + finally + { + App.Back(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32615.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32615.cs new file mode 100644 index 000000000000..217e5b4aad67 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32615.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla32615 : _IssuesUITest + { + public Bugzilla32615(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "OnAppearing is not called on previous page when modal page is popped"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task Bugzilla32615Test() + { + App.Tap("btnModal"); + App.Tap("btnPop"); + await Task.Delay(1000); + App.WaitForNoElement("1"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32830.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32830.cs new file mode 100644 index 000000000000..c592fde6c387 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32830.cs @@ -0,0 +1,35 @@ +#if !ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla32830 : _IssuesUITest + { + const string Button1 = "button1"; + const string Button2 = "button2"; + const string BottomLabel = "I am visible at the bottom of the page"; + + public Bugzilla32830(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Hiding navigation bar causes layouts to shift during navigation"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAllPlatforms] + public void Bugzilla32830Test() + { + App.WaitForNoElement(BottomLabel); + App.WaitForElement(Button1); + App.Tap(Button1); + App.WaitForElement(Button2); + App.Tap(Button2); + App.WaitForNoElement(BottomLabel); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32898.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32898.cs new file mode 100644 index 000000000000..38f8749ba006 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla32898.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla32898 : _IssuesUITest + { + const string Success = "Success"; + const int Timeout = 20000; + + public Bugzilla32898(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Memory leak when TabbedPage is popped out "; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issu32898Test() + { + var timeout = Timeout; // Give this a little slop to set the result text + App.WaitForNoElement(Success, timeout: TimeSpan.FromMilliseconds(timeout)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34007.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34007.cs new file mode 100644 index 000000000000..4b92370aef6d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34007.cs @@ -0,0 +1,44 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla34007 : _IssuesUITest + { + public Bugzilla34007(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Z order drawing of children views are different on Android, iOS, Win"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue34007TestFirstElementHasLowestZOrder() + { + var buttonLocations = App.WaitForElement("Button0"); + + var rect = buttonLocations.GetRect(); + var x = rect.CenterX(); + var y = rect.CenterY(); + + // Button 1 was the last item added to the grid; it should be tappable + App.Tap("Button1"); + + // The label should indicate that Button 1 was the last button tapped + App.WaitForNoElement("Button 1 was tapped last"); + + App.Screenshot("Buttons Reordered"); + + // Tapping Button1 1 reordered the buttons in the grid; Button 0 should + // now be on top. Tapping at the Button 1 location should actually tap + // Button 0, and the label should indicate that + App.TapCoordinates(x, y); + App.WaitForNoElement("Button 0 was tapped last"); + + App.Screenshot("Button 0 Tapped"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34061.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34061.cs new file mode 100644 index 000000000000..a4fbe00b308b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla34061.cs @@ -0,0 +1,31 @@ +#if !ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla34061 : _IssuesUITest + { + public Bugzilla34061(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "RelativeLayout - First child added after page display does not appear"; + + [Test] + [Ignore("The sample is crashing.")] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAllPlatforms("The sample is crashing. More information: https://github.com/dotnet/maui/issues/21204")] + public void Bugzilla34061Test() + { + App.Screenshot("I am at Bugzilla34061 "); + App.WaitForElement("btnAdd"); + App.Tap("btnAdd"); + App.WaitForElement("Remove Me"); + App.Screenshot("I see the button"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35472.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35472.cs new file mode 100644 index 000000000000..0a7991d59371 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35472.cs @@ -0,0 +1,40 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla35472 : _IssuesUITest + { + public Bugzilla35472(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "PopAsync during ScrollToAsync throws NullReferenceException"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue35472PopAsyncDuringAnimatedScrollToAsync() + { + try + { + App.WaitForElement("PushButton"); + App.Tap("PushButton"); + + App.WaitForElement("NowPushButton"); + App.Screenshot("On Page With ScrollView"); + App.Tap("NowPushButton"); + + App.WaitForNoElement("The test has passed"); + App.Screenshot("Success"); + } + finally + { + App.Back(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35477.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35477.cs new file mode 100644 index 000000000000..eac048767c40 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35477.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla35477 : _IssuesUITest + { + public Bugzilla35477(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Tapped event does not fire when added to Frame in Android AppCompat"; + + [Test] + [Category(UITestCategories.Frame)] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void TapGestureFiresOnFrame() + { + App.WaitForNoElement("No taps yet"); + App.WaitForElement("TapHere"); + App.Tap("TapHere"); + App.WaitForNoElement("Frame was tapped"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35733.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35733.cs new file mode 100644 index 000000000000..52048dbcd076 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35733.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla35733 : _IssuesUITest + { + public Bugzilla35733(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "iOS WebView crashes when loading an URL with encoded parameters"; + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla35733Test() + { + App.WaitForElement("btnGo"); + App.Tap("btnGo"); + App.WaitForElement("WebViewTest"); + App.Screenshot("I didn't crash"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35736.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35736.cs new file mode 100644 index 000000000000..b0ad32df683e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla35736.cs @@ -0,0 +1,30 @@ +#if IOS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla35736 : _IssuesUITest + { + public Bugzilla35736(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Editor does not update Text value from autocorrect when losing focus"; + + [Test] + [Category(UITestCategories.Editor)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS("Fails sometimes")] + public void Bugzilla35736Test() + { + App.WaitForElement("Bugzilla35736Editor"); + App.EnterText("Bugzilla35736Editor", "Testig"); + App.Tap("Bugzilla35736Button"); + ClassicAssert.AreEqual("Testing", App.FindElement("Bugzilla35736Label").GetText()); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36009.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36009.cs new file mode 100644 index 000000000000..7e7b0ec61b55 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36009.cs @@ -0,0 +1,27 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36009 : _IssuesUITest + { + public Bugzilla36009(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + + [Test] + [Category(UITestCategories.BoxView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid("The content is not visible. The test is failing.")] + [FailsOnIOS] + public void Bugzilla36009Test() + { + App.WaitForElement("Victory"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36559.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36559.cs new file mode 100644 index 000000000000..886b8c0f4ff9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36559.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36559 : _IssuesUITest + { + public Bugzilla36559(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[WP] Navigating to a ContentPage with a Grid inside a TableView affects Entry heights"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.TableView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla36559Test() + { + App.WaitForElement("entry"); + var result = App.WaitForElement("entry"); + ClassicAssert.AreNotEqual(result.GetRect().Height, -1); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36703.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36703.cs new file mode 100644 index 000000000000..ca52a33842eb --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36703.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36703 : _IssuesUITest + { + const string TestImage = "testimage"; + const string Success = "Success"; + const string Toggle = "toggle"; + const string Testing = "Testing..."; + + public Bugzilla36703(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "TapGestureRecognizer inside initially disable Image will never fire Tapped event"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void _36703Test() + { + App.WaitForElement(TestImage); + App.Tap(TestImage); + App.WaitForNoElement(Testing); + App.Tap(Toggle); + App.Tap(TestImage); + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36780.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36780.cs new file mode 100644 index 000000000000..528538c9b25b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36780.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36780 : _IssuesUITest + { + const string TestImage = "TestImage"; + const string Gesture1Success = "Gesture1Success"; + const string Gesture2Success = "Gesture2Success"; + const string Gesture3Success = "Gesture3Success"; + + public Bugzilla36780(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Multiple TapGestureRecognizers on an Object Are Not Fired"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void MultipleTapGestures() + { + App.WaitForElement(TestImage); + App.Tap(TestImage); + + App.WaitForNoElement(Gesture1Success); + App.WaitForNoElement(Gesture2Success); + App.WaitForNoElement(Gesture3Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36788.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36788.cs new file mode 100644 index 000000000000..3d8fc2fca696 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36788.cs @@ -0,0 +1,27 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36788 : _IssuesUITest + { + public Bugzilla36788(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Truncation Issues with Relative Layouts"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla36788Test() + { + App.WaitForNoElement("Passed"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36802.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36802.cs new file mode 100644 index 000000000000..06afb45eade0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla36802.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla36802 : _IssuesUITest + { + public Bugzilla36802(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] AccessoryView Partially Hidden When Using RecycleElement and GroupShortName"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla36802Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("AccessoryView partially hidden test"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla37625.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla37625.cs new file mode 100644 index 000000000000..315b70ea47bc --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla37625.cs @@ -0,0 +1,23 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla37625 : _IssuesUITest + { + public Bugzilla37625(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "App crashes when quickly adding/removing Image views (Windows UWP)"; + + [Test] + [Category(UITestCategories.Image)] + [Category(UITestCategories.Compatibility)] + public void Bugzilla37625Test() + { + App.WaitForElement("success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38723.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38723.cs new file mode 100644 index 000000000000..d1a16d8d8f35 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38723.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla38723 : _IssuesUITest + { + public Bugzilla38723(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Update Content in Picker's SelectedIndexChanged event causes NullReferenceException"; + + [Test] + [Category(UITestCategories.Picker)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla38723Test() + { + App.Tap("SELECT"); + App.WaitForNoElement("Selected"); + App.WaitForNoElement("SELECT"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38989.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38989.cs new file mode 100644 index 000000000000..0b5e85068ea0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla38989.cs @@ -0,0 +1,26 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla38989 : _IssuesUITest + { + const string Success = "If you can see this, the test passed."; + + public Bugzilla38989(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] NullReferenceException when using a custom ViewCellRenderer "; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + public void Bugzilla38989Test() + { + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39489.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39489.cs new file mode 100644 index 000000000000..ad9ef52f8f3c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39489.cs @@ -0,0 +1,40 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla39489 : _IssuesUITest + { + public Bugzilla39489(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Memory leak when using NavigationPage with Maps"; + + [Test] + [Category(UITestCategories.Maps)] + [Category(UITestCategories.Performance)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public async Task Bugzilla39489Test() + { + // Original bug report (https://bugzilla.xamarin.com/show_bug.cgi?id=39489) had a crash (OOM) after 25-30 + // page loads. Obviously it's going to depend heavily on the device and amount of available memory, but + // if this starts failing before 50 we'll know we've sprung another serious leak + int iterations = 50; + + for (int n = 0; n < iterations; n++) + { + App.WaitForElement("NewPage"); + App.Tap("NewPage"); + App.WaitForElement("NewPage"); + await Task.Delay(1000); + App.Back(); + } + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39636.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39636.cs new file mode 100644 index 000000000000..1b70094b7f70 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39636.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla39636 : _IssuesUITest + { + public Bugzilla39636(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Cannot use XamlC with OnPlatform in resources, it throws System.InvalidCastException"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void DoesNotCrash() + { + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39668.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39668.cs new file mode 100644 index 000000000000..19bd2d09834e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39668.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla39668 : _IssuesUITest + { + public Bugzilla39668(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Overriding ListView.CreateDefault Does Not Work on Windows"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla39668Test() + { + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39702.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39702.cs new file mode 100644 index 000000000000..7eabe29b9fd9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39702.cs @@ -0,0 +1,32 @@ + +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla39702 : _IssuesUITest + { + const string TheEntry = "TheEntry"; + const string Success = "Success"; + + public Bugzilla39702(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Cannot enter text when Entry is focus()'d from an editor completed event"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Focus)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task ControlCanBeFocusedByUnfocusedEvent() + { + App.WaitForElement(TheEntry); + await Task.Delay(4000); + App.EnterText(TheEntry, Success); // Should be typing into the Entry at this point + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39821.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39821.cs new file mode 100644 index 000000000000..4626075322ec --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla39821.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla39821 : _IssuesUITest + { + public Bugzilla39821(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ViewExtension.TranslateTo cannot be invoked on Main thread"; + + [Test] + [Category(UITestCategories.Animation)] + [Category(UITestCategories.Compatibility)] + [Ignore("Fails intermittently")] + public void DoesNotCrash() + { + App.Tap("Animate"); + App.WaitForNoElement("Success", timeout: TimeSpan.FromSeconds(25)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla40005.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla40005.cs new file mode 100644 index 000000000000..c35fb86989a5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla40005.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla40005 : _IssuesUITest + { + public const string GoToPage2 = "Go to Page 2"; + public const string PageOneLabel = "Page 1"; + public const string PageTwoLabel = "Page 2"; + + public Bugzilla40005(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Navigation Bar back button does not show when using InsertPageBefore"; + public override bool ResetMainPage => false; + + // Crashing when navigating + /* + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla40005Test() + { + App.WaitForElement(PageOneLabel); + App.Tap(GoToPage2); + App.WaitForElement(PageTwoLabel); + App.Back(); + App.WaitForElement(PageOneLabel); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41205.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41205.cs new file mode 100644 index 000000000000..e129adb71f0a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41205.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla41205 : _IssuesUITest + { + const string Success = "Pass"; + + public Bugzilla41205(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "UWP CreateDefault passes string instead of object"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void CreateDefaultPassesStringInsteadOfObject() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41600.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41600.cs new file mode 100644 index 000000000000..b4176cc56e0b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41600.cs @@ -0,0 +1,36 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla41600 : _IssuesUITest + { + const string BtnScrollToNonExistentItem = "btnScrollToNonExistentItem"; + const string BtnScrollToExistentItem = "btnScrollToExistentItem"; + const string FirstListItem = "0"; + const string MiddleListItem = "15"; + + public Bugzilla41600(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Invalid item param value for ScrollTo throws an error"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + public void Bugzilla41600Test() + { + App.WaitForElement(BtnScrollToNonExistentItem); + App.WaitForElement(BtnScrollToExistentItem); + + App.Tap(BtnScrollToNonExistentItem); + App.WaitForNoElement(FirstListItem); + + App.Tap(BtnScrollToExistentItem); + App.WaitForNoElement(MiddleListItem); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41619.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41619.cs new file mode 100644 index 000000000000..760c1b410839 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41619.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla41619 : _IssuesUITest + { + const double Success = 6; + + public Bugzilla41619(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[WinRT/UWP] Slider binding works incorrectly"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void SliderBinding() + { + App.WaitForNoElement(Success.ToString()); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41842.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41842.cs new file mode 100644 index 000000000000..cdbf1c325531 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla41842.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla41842 : _IssuesUITest + { + public Bugzilla41842(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Set FlyoutPage.Detail = New Page() twice will crash the application when set FlyoutLayoutBehavior = FlyoutLayoutBehavior.Split"; + + // Crash after navigation + /* + [Test] + [Ignore("The sample is crashing.")] + [Category(UITestCategories.FlyoutPage)] + [Category(UITestCategories.Compatibility)] + [FailsOnAllPlatforms("The sample is crashing. More information: https://github.com/dotnet/maui/issues/21205")] + public void Bugzilla41842Test() + { + App.WaitForElement("Success"); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42277.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42277.cs new file mode 100644 index 000000000000..90697902c740 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42277.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla42277 : _IssuesUITest + { + const string Success1 = "Success1"; + const string Success2 = "Success2"; + const string Success3 = "GroupedSuccess3"; + const string Success4 = "GroupedSuccess4"; + const string Success5 = "GroupedSuccess5"; + const string Success6 = "GroupedSuccess6"; + + public Bugzilla42277(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "DataTemplate System.InvalidCastException crash in 2.3.1-pre1"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla42277Test() + { + App.WaitForElement(Success1); + App.WaitForElement(Success2); + App.WaitForElement(Success3); + App.WaitForElement(Success4); + App.WaitForElement(Success5); + App.WaitForElement(Success6); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42956.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42956.cs new file mode 100644 index 000000000000..e771074abca9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla42956.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla42956 : _IssuesUITest + { + const string Success = "Success"; + + public Bugzilla42956(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + + // Crash after navigating + /* + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla42956Test() + { + App.WaitForElement(Success); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla43519.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla43519.cs new file mode 100644 index 000000000000..220fd2ee7d58 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla43519.cs @@ -0,0 +1,34 @@ +#if WINDOWS +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla43519 : _IssuesUITest + { + const string Pop = "PopModal"; + const string Push = "PushModal"; + const string Page2 = "Page 2"; + + public Bugzilla43519(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] FlyoutPage ArgumentException when nested in a TabbedPage and returning from modal page"; + + [Test] + [Category(UITestCategories.TabbedPage)] + [Category(UITestCategories.Compatibility)] + public void TabbedModalNavigation() + { + App.WaitForElement(Page2); + App.Tap(Page2); + App.WaitForElement(Push); + App.Tap(Push); + App.WaitForElement(Pop); + App.Tap(Pop); + App.WaitForElement(Page2); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44096.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44096.cs new file mode 100644 index 000000000000..7009b94916e4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44096.cs @@ -0,0 +1,104 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla44096 : _IssuesUITest + { + public Bugzilla44096(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => + "Grid, StackLayout, and ContentView still participate in hit testing on Android after IsEnabled is set to false"; + + /* + const string StackLayout = "stackLayout"; + const string ContentView = "contentView"; + const string Grid = "grid"; + const string RelativeLayout = "relativeLayout"; + + const string Child = "Child"; + const string ToggleColor = "color"; + const string ToggleIsEnabled = "disabled"; + const string Original = "Original"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void TestGrid() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + TestControl(Grid); + } + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void TestContentView() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + TestControl(ContentView); + } + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void TestStackLayout() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + TestControl(StackLayout); + } + + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAllPlatforms] + public void TestRelativeLayout() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + TestControl(RelativeLayout); + } + + void TestControl(string control) + { + App.WaitForElement(control); + App.Tap(control); + App.WaitForNoElement(Child); + + App.WaitForElement(ToggleColor); + App.Tap(ToggleColor); + + App.WaitForElement(control); + App.Tap(control); + App.WaitForNoElement(Child); + + App.WaitForElement(ToggleIsEnabled); + App.Tap(ToggleIsEnabled); + + App.WaitForElement(control); + App.Tap(control); + App.WaitForNoElement(Original); + + App.WaitForElement(ToggleColor); + App.Tap(ToggleColor); + + App.WaitForElement(control); + App.Tap(control); + App.WaitForNoElement(Original); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44176.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44176.cs new file mode 100644 index 000000000000..432bb3c05593 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44176.cs @@ -0,0 +1,80 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla44176 : _IssuesUITest + { + public Bugzilla44176(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "InputTransparent fails if BackgroundColor not explicitly set on Android"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla44176Test() + { + App.WaitForElement("grid"); + App.Tap("grid"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("contentView"); + App.Tap("contentView"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("stackLayout"); + App.Tap("stackLayout"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("color"); + App.Tap("color"); + + App.WaitForElement("grid"); + App.Tap("grid"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("contentView"); + App.Tap("contentView"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("stackLayout"); + App.Tap("stackLayout"); + App.WaitForNoElement("Parent"); + + App.WaitForElement("nontransparent"); + App.Tap("nontransparent"); + + App.WaitForElement("grid"); + App.Tap("grid"); + App.WaitForNoElement("Child"); + + App.WaitForElement("contentView"); + App.Tap("contentView"); + App.WaitForNoElement("Child"); + + App.WaitForElement("stackLayout"); + App.Tap("stackLayout"); + App.WaitForNoElement("Child"); + + App.WaitForElement("color"); + App.Tap("color"); + + App.WaitForElement("grid"); + App.Tap("grid"); + App.WaitForNoElement("Child"); + + App.WaitForElement("contentView"); + App.Tap("contentView"); + App.WaitForNoElement("Child"); + + App.WaitForElement("stackLayout"); + App.Tap("stackLayout"); + App.WaitForNoElement("Child"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44476.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44476.cs new file mode 100644 index 000000000000..ff53eb5ce9b3 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla44476.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla44476 : _IssuesUITest + { + public Bugzilla44476(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue44476TestUnwantedMargin() + { + App.WaitForNoElement("This should be visible."); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45702.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45702.cs new file mode 100644 index 000000000000..83b50aa7dcce --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45702.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla45702 : _IssuesUITest + { + public Bugzilla45702(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Disabling back press on modal page causes app to crash"; + public override bool ResetMainPage => false; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + App.ResetApp(); + } + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue45702Test() + { + App.WaitForElement("ClickMe"); + App.Tap("ClickMe"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45722.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45722.cs new file mode 100644 index 000000000000..037c964035b0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla45722.cs @@ -0,0 +1,37 @@ +#if WINDOWS +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla45722 : _IssuesUITest + { + const string Success = "Success"; + const string Update = "Update List"; + const string Collect = "GC"; + + public Bugzilla45722(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Memory leak in Xamarin Forms ListView"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + public void LabelsInListViewTemplatesShouldBeCollected() + { + App.WaitForElement(Update); + + for (int n = 0; n < 10; n++) + { + App.Tap(Update); + } + + App.Tap(Collect); + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla46458.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla46458.cs new file mode 100644 index 000000000000..42fa82c716df --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla46458.cs @@ -0,0 +1,43 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla46458 : _IssuesUITest + { + public Bugzilla46458(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Grid.IsEnabled property is not working"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void GridIsEnabled() + { + App.WaitForElement("entry"); + App.Tap("entry"); + App.WaitForNoElement("Success"); + + App.WaitForElement("button"); + App.Tap("button"); + App.WaitForNoElement("Success"); + + App.WaitForElement("button1"); + App.Tap("button1"); + App.WaitForElement("Clicked"); + + App.WaitForElement("entry"); + App.Tap("entry"); + App.WaitForNoElement("Success"); + + App.WaitForElement("button"); + App.Tap("button"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla49069.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla49069.cs new file mode 100644 index 000000000000..c6a7d9ab06ca --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla49069.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla49069 : _IssuesUITest + { + public Bugzilla49069(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Java.Lang.ArrayIndexOutOfBoundsException when rendering long Label on Android"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla49069Test() + { + App.WaitForElement("lblLong"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51238.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51238.cs new file mode 100644 index 000000000000..df7a482a17da --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51238.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla51238 : _IssuesUITest + { + public Bugzilla51238(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Transparent Grid causes Java.Lang.IllegalStateException: Unable to create layer for Platform_DefaultRenderer"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue1Test() + { + App.WaitForElement("TapMe"); + App.Tap("TapMe"); // Crashes the app if the issue isn't fixed + App.WaitForElement("TapMe"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51503.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51503.cs new file mode 100644 index 000000000000..7e0af6989bd6 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51503.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla51503 : _IssuesUITest + { + public Bugzilla51503(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NullReferenceException on VisualElement Finalize"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Issue51503Test() + { + for (int i = 0; i < 3; i++) + { + App.WaitForElement("Button"); + + App.Tap("Button"); + + App.WaitForElement("VisualElement"); + + App.Back(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51505.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51505.cs new file mode 100644 index 000000000000..bc84786ffb74 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla51505.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla51505 : _IssuesUITest + { + const string ButtonId = "button"; + + public Bugzilla51505(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ObjectDisposedException On Effect detachment."; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Effects)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla51505Test() + { + App.WaitForElement(ButtonId); + Assert.DoesNotThrow(() => App.Tap(ButtonId)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla52533.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla52533.cs new file mode 100644 index 000000000000..31cd77dc221e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla52533.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla52533 : _IssuesUITest + { + const string LabelId = "label"; + + public Bugzilla52533(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "System.ArgumentException: NaN is not a valid value for width"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla52533Test() + { + App.WaitForElement(LabelId); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53179.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53179.cs new file mode 100644 index 000000000000..d82ccae2d2d5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53179.cs @@ -0,0 +1,40 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla53179 : _IssuesUITest + { + public Bugzilla53179(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "PopAsync crashing after RemovePage when support packages are updated to 25.1.1"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Bugzilla53179Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("Next Page"); + App.Tap("Next Page"); + + App.WaitForElement("Next Page"); + App.Tap("Next Page"); + + App.WaitForElement("Next Page"); + App.Tap("Next Page"); + + App.WaitForElement("Remove previous pages"); + App.Tap("Remove previous pages"); + + App.WaitForElement("Back"); + App.Tap("Back"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53445.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53445.cs new file mode 100644 index 000000000000..223505bb6ec5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53445.cs @@ -0,0 +1,39 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla53445 : _IssuesUITest + { + public Bugzilla53445(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Setting Grid.IsEnabled to false does not disable child controls"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Test() + { + App.WaitForElement("Success"); + + // Disable the layouts + App.Tap("toggle"); + + // Tap the grid button; the event should not fire and the label should not change + App.Tap("gridbutton"); + App.WaitForElement("Success"); + + // Tap the contentview button; the event should not fire and the label should not change + App.Tap("contentviewbutton"); + App.WaitForElement("Success"); + + // Tap the stacklayout button; the event should not fire and the label should not change + App.Tap("stacklayoutbutton"); + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53834.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53834.cs new file mode 100644 index 000000000000..dff727370d05 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla53834.cs @@ -0,0 +1,27 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla53834 : _IssuesUITest + { + public Bugzilla53834(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "incorrect row heights on ios when using groupheadertemplate in Xamarin.Forms 2.3.4.214-pre5"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla53834Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("Incorrect row heights test"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55365.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55365.cs new file mode 100644 index 000000000000..5aa98188a209 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55365.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla55365 : _IssuesUITest + { + public Bugzilla55365(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "~VisualElement crashes with System.Runtime.InteropServices.COMException"; + + [Test] + [Category(UITestCategories.ViewBaseTests)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ForcingGCDoesNotCrash() + { + App.WaitForElement("Clear"); + App.Tap("Clear"); + App.Tap("Garbage"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55745.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55745.cs new file mode 100644 index 000000000000..ebcb91c639c4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55745.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla55745 : _IssuesUITest + { + const string ButtonId = "button"; + + public Bugzilla55745(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] NRE in ListView with HasUnevenRows=true after changing content and rebinding"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla55745Test() + { + App.WaitForElement(ButtonId); + App.Tap(ButtonId); + App.Tap(ButtonId); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55912.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55912.cs new file mode 100644 index 000000000000..1dcf374de1b6 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla55912.cs @@ -0,0 +1,42 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla55912 : _IssuesUITest + { + const string Success = "Success"; + const string GridLabelId = "GridLabel"; + const string StackLabelId = "StackLabel"; + + public Bugzilla55912(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Tap event not always propagated to containing Grid/StackLayout"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void GestureBubblingInStackLayout() + { + App.WaitForElement(StackLabelId); + App.Tap(StackLabelId); + App.WaitForElement(Success); + } + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Layout)] + [FailsOnIOS] + public void GestureBubblingInGrid() + { + App.WaitForElement(GridLabelId); + App.Tap(GridLabelId); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56298.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56298.cs new file mode 100644 index 000000000000..f2b877a884e3 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56298.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla56298 : _IssuesUITest + { + public Bugzilla56298(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Changing ListViews HasUnevenRows at runtime on iOS has no effect"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla56298Test() + { + App.WaitForElement("btnAdd"); + App.Tap("btnAdd"); + App.Tap("btnToggle"); + App.Screenshot("Verify we see uneven rows"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56771.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56771.cs new file mode 100644 index 000000000000..47f5e1a20cb3 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56771.cs @@ -0,0 +1,31 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla56771 : _IssuesUITest + { + const string Success = "Success"; + const string BtnAdd = "btnAdd"; + + public Bugzilla56771(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Multi-item add in INotifyCollectionChanged causes a NSInternalInconsistencyException in bindings on iOS"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla56771Test() + { + App.WaitForElement(BtnAdd); + App.Tap(BtnAdd); + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56896.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56896.cs new file mode 100644 index 000000000000..2d43acb253d1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla56896.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla56896 : _IssuesUITest + { + const string InstructionsId = "InstructionsId"; + const string ConstructorCountId = "constructorCount"; + const string TimeId = "time"; + + public Bugzilla56896(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListViews for lists with many elements regressed in performance on iOS"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ListViewsWithManyElementsPerformanceCheck() + { + App.WaitForElement(InstructionsId); + App.WaitForElement(ConstructorCountId); + App.WaitForElement(TimeId); + int.TryParse(App.WaitForElement(ConstructorCountId).GetText(), out int count); + ClassicAssert.IsTrue(count < 100); // Failing test makes ~15000 constructor calls + int.TryParse(App.WaitForElement(TimeId).GetText(), out int time); + ClassicAssert.IsTrue(count < 2000); // Failing test takes ~4000ms + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57114.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57114.cs new file mode 100644 index 000000000000..19b747d2abc7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57114.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla57114 : _IssuesUITest + { + const string Testing = "Testing..."; + const string Success = "Success"; + const string ViewAutomationId = "_57114View"; + + public Bugzilla57114(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Forms gestures are not supported on UIViews that have native gestures"; + + // Crash after navigation + /* + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void _57114BothTypesOfGesturesFire() + { + App.WaitForNoElement(Testing); + App.Tap(ViewAutomationId); + App.WaitForNoElement(Success); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57674.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57674.cs new file mode 100644 index 000000000000..293ffb1b6297 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57674.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla57674 : _IssuesUITest + { + public Bugzilla57674(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView not honoring INotifyCollectionChanged"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Bugzilla57674Test() + { + App.Screenshot("Initial Status"); + App.WaitForElement("IssueListView"); + App.Tap("IssueButton"); + App.Screenshot("Element Added to List"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57758.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57758.cs new file mode 100644 index 000000000000..6e76371144c4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57758.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla57758 : _IssuesUITest + { + const string ImageId = "TestImageId"; + + public Bugzilla57758(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ObjectDisposedException for Microsoft.Maui.Controls.Platform.Android.FastRenderers.ImageRenderer"; + + [Test] + [Category(UITestCategories.Image)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void RemovingImageWithGestureFromLayoutWithinGestureHandlerDoesNotCrash() + { + App.WaitForElement(ImageId); + App.Tap(ImageId); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57910.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57910.cs new file mode 100644 index 000000000000..3405ed792f03 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla57910.cs @@ -0,0 +1,40 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla57910 : _IssuesUITest + { + const string ButtonId = "btnPush"; + const string Button2Id = "btnPop"; + + public Bugzilla57910(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + public override bool ResetMainPage => false; + + // Crash after navigation + /* + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Bugzilla57910Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + for (int i = 0; i < 10; i++) + { + App.WaitForElement(ButtonId); + App.Tap(ButtonId); + App.WaitForElement(Button2Id); + App.Tap(Button2Id); + } + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla58645.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla58645.cs new file mode 100644 index 000000000000..e8bbd5ac159b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla58645.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla58645 : _IssuesUITest + { + const string ButtonId = "button"; + + public Bugzilla58645(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] NRE Thrown When ListView Items Are Replaced By Items With a Different Template"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla58645Test() + { + App.WaitForElement(ButtonId); + App.Tap(ButtonId); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59097.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59097.cs new file mode 100644 index 000000000000..be44bc8323e5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59097.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla59097 : _IssuesUITest + { + public Bugzilla59097(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Calling PopAsync via TapGestureRecognizer causes an application crash"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + public void Bugzilla59097Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("boxView"); + App.Tap("boxView"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59172.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59172.cs new file mode 100644 index 000000000000..34d1e1553055 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59172.cs @@ -0,0 +1,55 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla59172 : _IssuesUITest + { + public Bugzilla59172(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Popped page does not appear on top of current navigation stack, please file a bug."; + public override bool ResetMainPage => false; + + // Test scenario: Tapping the GoBack link triggers a PopAsync 2500ms after the tap event. + // Right before PopAsync is triggered, manually navigate back pressing the back arrow in the navigation bar + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public async Task Issue59172Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("GoForward"); + App.Tap("GoBackDelayed"); + App.Back(); + + await Task.Delay(1000); + + // App should not have crashed + App.WaitForElement("GoForward"); + } + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public async Task Issue59172RecoveryTest() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("GoForward"); + App.Tap("GoBackDelayedSafe"); + App.Back(); + + await Task.Delay(1000); + + App.Tap("GoForward"); + + // App should navigate + App.WaitForElement("GoBackDelayedSafe"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59896.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59896.cs new file mode 100644 index 000000000000..e3895d53f0cd --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59896.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla59896 : _IssuesUITest + { + const string BtnAdd = "btnAdd"; + + public Bugzilla59896(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "v2.4.0: Adding inserting section to ListView causes crash IF first section is empty"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla59896Test() + { + App.WaitForElement(BtnAdd); + App.Tap(BtnAdd); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59925.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59925.cs new file mode 100644 index 000000000000..9ab146b3fce5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla59925.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla59925 : _IssuesUITest + { + public Bugzilla59925(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Font size does not change vertical height of Entry on iOS"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue123456Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("I am at Issue 59925"); + App.WaitForElement("Bigger"); + App.Screenshot("0"); + + App.Tap("Bigger"); + App.Screenshot("1"); + + App.Tap("Bigger"); + App.Screenshot("2"); + + App.Tap("Bigger"); + App.Screenshot("3"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla60123.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla60123.cs new file mode 100644 index 000000000000..94bba232fe98 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla60123.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Bugzilla60123 : _IssuesUITest + { + public Bugzilla60123(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Rui's issue"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1Test() + { + App.WaitForElement("ListView"); + App.ScrollDown("ListView"); + App.WaitForElement("ListView"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1567.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1567.cs new file mode 100644 index 000000000000..2f715f9a11cf --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1567.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class GitHub1567 : _IssuesUITest + { + public GitHub1567(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NRE using TapGestureRecognizer on cell with HasUnevenRows"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + public void GitHub1567Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("btnFillData"); + App.Tap("btnFillData"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1648.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1648.cs new file mode 100644 index 000000000000..41f242c5e6a8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/GitHub1648.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class GitHub1648 : _IssuesUITest + { + public GitHub1648(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "FlyoutPage throws ArgumentOutOfRangeException"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void GitHub1648Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForElement("Reload"); + App.Tap("Reload"); + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github1625.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github1625.cs new file mode 100644 index 000000000000..dad6b5a96c2a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github1625.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Github1625 : _IssuesUITest + { + public Github1625(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Slider value is not changed for the first position change"; + + [Test] + [Category(UITestCategories.Slider)] + [Category(UITestCategories.Compatibility)] + public void SettingSliderToSpecificValueWorks() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("LabelValue"); + ClassicAssert.AreEqual("5", App.WaitForElement("LabelValue").GetText()); + App.Tap("SetTo7"); + ClassicAssert.AreEqual("7", App.WaitForElement("LabelValue").GetText()); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github6384.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github6384.cs new file mode 100644 index 000000000000..1eb18ad65ddc --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Github6384.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Github6384 : _IssuesUITest + { + public Github6384(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "content page in tabbed page not showing inside shell tab"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Github6384Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("I am at Github6384"); + App.WaitForElement("NavigationButton"); + App.Tap("NavigationButton"); + App.WaitForElement("SubTabLabel1"); + // The label is visible! + // Note: This check only catches the bug on iOS. Android will pass also without the fix. + App.Screenshot("The new page is visible!"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10182.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10182.cs new file mode 100644 index 000000000000..25967b1af065 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10182.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue10182 : _IssuesUITest + { + public Issue10182(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid("MultiWindowService not implemented.")] + [FailsOnIOS] + public void AppDoesntCrashWhenResettingPage() + { + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs new file mode 100644 index 000000000000..29a3e1804ae7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue10222 : _IssuesUITest + { + public Issue10222(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + public override bool ResetMainPage => false; + + // Crash after navigation + /* + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + public void Issue10222Test() + { + App.WaitForElement("goTo"); + App.Tap("goTo"); + App.WaitForElement("collectionView"); + App.WaitForElement("goTo"); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1023.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1023.cs new file mode 100644 index 000000000000..9d086857dd8c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1023.cs @@ -0,0 +1,41 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1023 : _IssuesUITest + { + public Issue1023(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Exception Ancestor must be provided for all pushes except first"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Picker)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Bugzilla1023Test() + { + for (var n = 0; n < 10; n++) + { + App.WaitForElement("Push"); + App.Tap("Push"); + + App.WaitForElement("ListView"); + App.Back(); + } + + // At this point, the counter can be any value, but it's most likely not zero. + // Invoking GC once is enough to clean up all garbage data and set counter to zero + App.WaitForElement("GC"); + App.Tap("GC"); + + App.WaitForNoElement("Counter: 0"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10454.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10454.cs new file mode 100644 index 000000000000..f003f28882c9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10454.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue10454 : _IssuesUITest + { + const string Success = "Success"; + + public Issue10454(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "CollectionView ChildAdded"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ChildAddedShouldFire() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs new file mode 100644 index 000000000000..9c5c016fcfd0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs @@ -0,0 +1,51 @@ +#if ANDROID || IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue10563 : _IssuesUITest + { + const string OpenLeftId = "OpenLeftId"; + const string OpenRightId = "OpenRightId"; + const string OpenTopId = "OpenTopId"; + const string OpenBottomId = "OpenBottomId"; + const string CloseId = "CloseId"; + + public Issue10563(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] SwipeView Open methods does not work for RightItems"; + + [Test] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue10563OpenSwipeViewTest() + { + App.WaitForElement(OpenLeftId); + App.Tap(OpenLeftId); + App.Screenshot("Left SwipeItems"); + App.Tap(CloseId); + + App.WaitForElement(OpenRightId); + App.Tap(OpenRightId); + App.Screenshot("Right SwipeItems"); + + App.Tap(CloseId); + + App.WaitForElement(OpenTopId); + App.Tap(OpenTopId); + App.Screenshot("Top SwipeItems"); + App.Tap(CloseId); + + App.WaitForElement(OpenBottomId); + App.Tap(OpenBottomId); + App.Screenshot("Bottom SwipeItems"); + App.Tap(CloseId); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10744.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10744.cs new file mode 100644 index 000000000000..e3a2dda3d066 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10744.cs @@ -0,0 +1,23 @@ +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue10744 : _IssuesUITest + { + public Issue10744(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] WebView.Eval crashes on Android with long string"; + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void WebViewEvalCrashesOnAndroidWithLongString() + { + App.WaitForElement("navigatedLabel"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11132.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11132.cs new file mode 100644 index 000000000000..092dcc7df33c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11132.cs @@ -0,0 +1,32 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11132 : _IssuesUITest + { + const string InstructionsId = "instructions"; + + public Issue11132(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [iOS] UpdateClip throws NullReferenceException when the Name of the Mask of the Layer is null"; + + /* + [Test] + [Description("Verify that can use a CustomRenderer overriding the iOS View Layer properties")] + [Category(UITestCategories.Frame)] + [Category(UITestCategories.CustomHandlers)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue11132CustomRendererLayerAndClip() + { + App.WaitForElement(InstructionsId); + App.Screenshot("No crash"); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11209.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11209.cs new file mode 100644 index 000000000000..139b6c512c99 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11209.cs @@ -0,0 +1,32 @@ +#if ANDROID || IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11209 : _IssuesUITest + { + const string SwipeViewContent = "SwipeViewContent"; + const string Success = "Success"; + + public Issue11209(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [iOS][SwipeView] Swipe view not handling tap gesture events until swiped"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void TapSwipeViewAndNavigateTest() + { + App.WaitForElement(SwipeViewContent); + App.Tap(SwipeViewContent); + App.WaitForElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11311.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11311.cs new file mode 100644 index 000000000000..bd1a9ba9a263 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11311.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11311 : _IssuesUITest + { + public Issue11311(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Regression] CollectionView NSRangeException"; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + App.Back(); + } + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.TabbedPage)] + [Category(UITestCategories.Compatibility)] + public void CollectionViewWithFooterShouldNotCrashOnDisplay() + { + // If this hasn't already crashed, the test is passing + App.FindElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11333.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11333.cs new file mode 100644 index 000000000000..7892c225afc0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11333.cs @@ -0,0 +1,33 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11333 : _IssuesUITest + { + public Issue11333(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] SwipeView does not work on Android if child has TapGestureRecognizer"; + + /* + const string SwipeViewId = "SwipeViewId"; + + [Test] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void SwipeWithChildGestureRecognizer() + { + App.WaitForElement(SwipeViewId); + App.SwipeRightToLeft(); + App.Tap(SwipeViewId); + App.WaitForElement("ResultLabel"); + } + */ + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1146.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1146.cs new file mode 100644 index 000000000000..6e3eddcd50f7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1146.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1146 : _IssuesUITest + { + public Issue1146(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Disabled Switch in Button Gallery not rendering on all devices"; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void TestSwitchDisable() + { + App.WaitForElement("switch"); + App.Screenshot(); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11769.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11769.cs new file mode 100644 index 000000000000..8359409ae49e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11769.cs @@ -0,0 +1,67 @@ +/* +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11769_DelayedShellContent : _IssuesUITest + { + public Issue11769_DelayedShellContent(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Shell throws exception when delay adding Shell Content"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void DelayedAddingOfShellContentDoesntCrash() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("Success"); + } + } + + public class Issue11769_DelayedShellSection : _IssuesUITest + { + public Issue11769_DelayedShellSection(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Shell throws exception when delay adding Shell Section"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void DelayedAddingOfShellSectionDoesntCrash() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("Success"); + } + } + + public class Issue11769_DelayedShellItem : _IssuesUITest + { + public Issue11769_DelayedShellItem(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Shell throws exception when delay adding Shell Item"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void DelayedAddingOfShellItemDoesntCrash() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("Success"); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11853.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11853.cs new file mode 100644 index 000000000000..f59c8c9cb30d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11853.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11853 : _IssuesUITest + { + const string Run = "Run"; + + public Issue11853(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug][iOS] Concurrent issue leading to crash in SemaphoreSlim.Release in ObservableItemsSource"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void JustWhalingAwayOnTheCollectionViewWithAddsAndClearsShouldNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(Run); + App.Tap(Run); + Task.Delay(5000).Wait(); + App.Tap(Run); + Task.Delay(5000).Wait(); + + // If we can still find the button, then we didn't crash + App.WaitForElement(Run); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11962.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11962.cs new file mode 100644 index 000000000000..b601a7ba4174 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11962.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11962 : _IssuesUITest + { + public Issue11962(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Cannot access a disposed object. Object name: 'WkWebViewRenderer"; + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void WebViewDisposesProperly() + { + App.Tap("NextButton"); + App.Tap("BackButton"); + App.Tap("NextButton"); + App.Tap("BackButton"); + App.Tap("NextButton"); + App.Tap("BackButton"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11969.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11969.cs new file mode 100644 index 000000000000..a0c6232a89e1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue11969.cs @@ -0,0 +1,37 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue11969 : _IssuesUITest + { + const string SwipeViewId = "SwipeViewId"; + const string SwipeButtonId = "SwipeButtonId"; + + const string Failed = "SwipeView Button not tapped"; + const string Success = "SUCCESS"; + + public Issue11969(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Disabling Swipe view not handling tap gesture events on the content in iOS of Xamarin Forms"; + + [Test] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void SwipeDisableChildButtonTest() + { + App.WaitForNoElement(Failed); + App.WaitForElement(SwipeViewId); + App.Tap("SwipeViewCheckBoxId"); + App.Tap("SwipeViewContentCheckBoxId"); + App.Tap(SwipeButtonId); + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12060.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12060.cs new file mode 100644 index 000000000000..102dc0962e40 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12060.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12060 : _IssuesUITest + { + public Issue12060(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Bug] DragGestureRecognizer shows 'Copy' tag when dragging in UWP"; + + [Test] + [Category(UITestCategories.DragAndDrop)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void AcceptedOperationNoneDisablesDropOperation() + { + App.WaitForElement("TestLoaded"); + App.DragAndDrop("DragBox", "DropBox"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12079.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12079.cs new file mode 100644 index 000000000000..1a529ae197bd --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12079.cs @@ -0,0 +1,32 @@ +#if WINDOWS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12079 : _IssuesUITest + { + const string SwipeViewId = "SwipeViewId"; + + public Issue12079(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "SwipeView crash if Text not is set on SwipeItem"; + + [Test] + [Ignore("Appium cannot find the SwipeControl, we have to review the reason.")] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + public void SwipeItemNoTextWindows() + { + App.WaitForElement(SwipeViewId); + App.SwipeLeftToRight(SwipeViewId); + App.Tap(SwipeViewId); + App.WaitForNoElement("Success"); + App.Screenshot("The test has passed"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12134.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12134.cs new file mode 100644 index 000000000000..fc5e9352a910 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12134.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12134 : _IssuesUITest + { + public Issue12134(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] WkWebView does not handle cookies consistently"; + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void CookiesCorrectlyLoadWithMultipleWebViews() + { + for (int i = 0; i < 10; i++) + { + App.WaitForNoElement("Success", $"Failied on: {i}"); + App.Tap("LoadNewWebView"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12153.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12153.cs new file mode 100644 index 000000000000..52e9ecae5f6d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12153.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12153 : _IssuesUITest + { + public Issue12153(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Setting FontFamily to pre-installed fonts on UWP crashes"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void InvalidFontDoesntCauseAppToCrash() + { + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1219.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1219.cs new file mode 100644 index 000000000000..0420d0d62255 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1219.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1219 : _IssuesUITest + { + const string Success = "Success"; + + public Issue1219(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Setting ToolbarItems in ContentPage constructor crashes app"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ViewCellInTableViewDoesNotCrash() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12193.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12193.cs new file mode 100644 index 000000000000..7297c7912dcc --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12193.cs @@ -0,0 +1,43 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12193 : _IssuesUITest + { + const string HTML = "HTML"; + + public Issue12193(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CarouselView content disappears after 2 rotations if TextType=Html is used"; + + [Test] + [Category(UITestCategories.CarouselView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task RotatingCarouselViewHTMLShouldNotDisappear() + { + int delay = 3000; + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.SetOrientationLandscape(); + await Task.Delay(delay); + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.SetOrientationLandscape(); + await Task.Delay(delay); + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.WaitForElement(HTML); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12246.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12246.cs new file mode 100644 index 000000000000..93f613870c64 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12246.cs @@ -0,0 +1,39 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12246 : _IssuesUITest + { + const string Entry = "Entry"; + const string Password = "Password"; + const string Success = "Success"; + + public Issue12246(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] iOS 14 App freezes when password is entered after email"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void UnfocusingPasswordDoesNotHang() + { + App.WaitForElement(Entry); + App.WaitForElement(Password); + + App.EnterText(Entry, "test"); + App.DismissKeyboard(); + App.EnterText(Password, "test"); + + App.Tap(Entry); + App.DismissKeyboard(); + App.WaitForElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1236.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1236.cs new file mode 100644 index 000000000000..68ecc1e736ed --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1236.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1236 : _IssuesUITest + { + public Issue1236(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Label binding"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void DelayedLabelBindingShowsUp() + { + Task.Delay(2000).Wait(); + App.WaitForNoElement("Lorem Ipsum Dolor Sit Amet"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12374.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12374.cs new file mode 100644 index 000000000000..4f069addf166 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12374.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12374 : _IssuesUITest + { + public Issue12374(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] iOS XF 5.0-pre1 crash with CollectionView when using EmptyView"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue12374Test() + { + App.WaitForElement("TestReady"); + App.Tap("RemoveItems"); + App.Tap("AddItems"); + App.Tap("RemoveItems"); + App.Screenshot("CollectionViewWithEmptyView"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12484.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12484.cs new file mode 100644 index 000000000000..de4d58b19760 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12484.cs @@ -0,0 +1,26 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12484 : _IssuesUITest + { + public Issue12484(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Unable to set ControlTemplate for TemplatedView in Xamarin.Forms version 5.0"; + + [Test] + [Category(UITestCategories.ViewBaseTests)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Issue12484ControlTemplateRendererTest() + { + App.WaitForNoElement("Success"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs new file mode 100644 index 000000000000..477d39e5380e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12642.cs @@ -0,0 +1,30 @@ +/* +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12642 : _IssuesUITest + { + public Issue12642(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Rapid ShellContent Navigation Causes Blank Screens"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void ClickingQuicklyBetweenTopTabsBreaksContent() + { + App.Tap("AutomatedRun"); + App.WaitForElement("Success"); + App.Tap("AutomatedRun"); + App.WaitForElement("Success"); + } + } +} +#endif +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1267.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1267.cs new file mode 100644 index 000000000000..b487ef1ddd6b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1267.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1267 : _IssuesUITest + { + const string Success = "If this is visible, the test has passed."; + + public Issue1267(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Star '*' in Grid layout throws exception"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void StarInGridDoesNotCrash() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12714.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12714.cs new file mode 100644 index 000000000000..a85c3482a5d3 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12714.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12714 : _IssuesUITest + { + const string Success = "Success"; + const string Show = "Show"; + + public Issue12714(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] iOS application suspended at UICollectionViewFlowLayout.PrepareLayout() when using IsVisible = false"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void InitiallyInvisbleCollectionViewSurvivesiOSLayoutNonsense() + { + App.WaitForElement(Show); + App.Tap(Show); + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12777.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12777.cs new file mode 100644 index 000000000000..e4f826af1bdb --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12777.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12777 : _IssuesUITest + { + public Issue12777(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CarouselView NRE if item template is not specified"; + + [Test] + [Category(UITestCategories.CarouselView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue12777Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("TestCarouselView"); + App.Screenshot("Test passed"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12848.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12848.cs new file mode 100644 index 000000000000..e01c8f6731b5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12848.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue12848 : _IssuesUITest + { + public Issue12848(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CarouselView position resets when visibility toggled"; + + [Test] + [Category(UITestCategories.CarouselView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue12848Test() + { + App.WaitForElement("TestCarouselView"); + App.SwipeRightToLeft(); + int.TryParse(App.FindElement("CarouselPosition").GetText(), out int position1); + ClassicAssert.AreEqual(1, position1); + App.Tap("HideButton"); + App.Tap("ShowButton"); + int.TryParse(App.FindElement("CarouselPosition").GetText(), out int position2); + ClassicAssert.AreEqual(1, position2); + App.Screenshot("Test passed"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13126_2.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13126_2.cs new file mode 100644 index 000000000000..bdc8f4812331 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13126_2.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13126_2 : _IssuesUITest + { + const string Success = "Success"; + + public Issue13126_2(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Regression: 5.0.0-pre5 often fails to draw dynamically loaded collection view content"; + + [Test] + [Category(UITestCategories.CollectionView)] + [FailsOnIOS] + public void CollectionViewShouldSourceShouldResetWhileInvisible() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13203.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13203.cs new file mode 100644 index 000000000000..2452704adbbd --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13203.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13203 : _IssuesUITest + { + const string Success = "Success"; + + public Issue13203(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [iOS] CollectionView does not bind to items if `IsVisible=False`"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void CollectionShouldInvalidateOnVisibilityChange() + { + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13390.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13390.cs new file mode 100644 index 000000000000..735f53280837 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13390.cs @@ -0,0 +1,27 @@ +/* +#if IOS +using NUnit.Framework; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13390 : _IssuesUITest + { + public Issue13390(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Custom SlideFlyoutTransition is not working"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void CustomSlideFlyoutTransitionCausesCrash() + { + // If this hasn't already crashed, the test is passing + App.WaitForElement("Success"); + } + } +} +#endif +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13436.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13436.cs new file mode 100644 index 000000000000..1492a853d436 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13436.cs @@ -0,0 +1,25 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13436 : _IssuesUITest + { + public Issue13436(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Java.Lang.IllegalArgumentException in CarouselView adjusting PeekAreaInsets in OnSizeAllocated using XF 5.0"; + + [Test] + [Category(UITestCategories.CarouselView)] + [Category(UITestCategories.Compatibility)] + public void ChangePeekAreaInsetsInOnSizeAllocatedTest() + { + App.WaitForElement("CarouselId"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs new file mode 100644 index 000000000000..5811b66bfd79 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13476.cs @@ -0,0 +1,33 @@ +/* +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13476 : _IssuesUITest + { + public Issue13476(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Shell Title View Test"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void TitleViewHeightDoesntOverflow() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + var titleView = App.WaitForElement("TitleViewId").GetRect(); + var topTab = App.WaitForElement("page 1").GetRect(); + + var titleViewBottom = titleView.Y + titleView.Height; + var topTabTop = topTab.Y; + + ClassicAssert.GreaterOrEqual(topTabTop, titleViewBottom, "Title View is incorrectly positioned behind tabs"); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1355.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1355.cs new file mode 100644 index 000000000000..e864d4f71a6d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1355.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1355 : _IssuesUITest + { + const string Success = "Success"; + + public Issue1355(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Setting Main Page in quick succession causes crash on Android"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void SwitchMainPageOnAppearing() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + // Without the fix, this would crash. If we're here at all, the test passed. + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13551.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13551.cs new file mode 100644 index 000000000000..4f1fec964b31 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13551.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13551 : _IssuesUITest + { + const string Success1 = "Success1"; + const string Success2 = "Success2"; + + public Issue13551(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [iOS] CollectionView does not display items if `IsVisible` modified via a binding/trigger"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void CollectionViewWithFooterShouldNotCrashOnDisplay() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement(Success1); + App.WaitForNoElement(Success2); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13616.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13616.cs new file mode 100644 index 000000000000..8f1112b35d70 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13616.cs @@ -0,0 +1,27 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13616 : _IssuesUITest + { + public Issue13616(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] After updating XF 5.0.0.1931 getting Java.Lang.IllegalArgumentException: Invalid target position at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod"; + + [Test] + [Category(UITestCategories.CarouselView)] + [Category(UITestCategories.Compatibility)] + public void Issue13616Test() + { + App.WaitForElement("AddItemButtonId"); + App.Tap("AddItemButtonId"); + App.WaitForElement("CarouselViewId"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13916.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13916.cs new file mode 100644 index 000000000000..787d6ec81b59 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue13916.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue13916 : _IssuesUITest + { + public Issue13916(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] iOS Application crashes on Back press when navigated to using GoToAsync with \"//\" or \"///\" route if 2 or more things are removed from the navigation stack"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void RemovingMoreThanOneInnerPageAndThenPushingAPageCrashes() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("ClickMe1"); + App.Tap("ClickMe2"); + App.Tap("ClickMe3"); + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1426.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1426.cs new file mode 100644 index 000000000000..b790fb887a46 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1426.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1426 : _IssuesUITest + { + public Issue1426(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "SetHasNavigationBar screen height wrong"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + public void Github1426Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("You can see the coffe mug"); + App.WaitForElement("CoffeeImageId"); + App.WaitForElement("NextButtonID"); + App.Tap("NextButtonID"); + App.WaitForElement("PopButtonId"); + App.Tap("PopButtonId"); + App.WaitForElement("CoffeeImageId"); + App.Screenshot("Coffe mug Image is still there on the bottom"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1436.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1436.cs new file mode 100644 index 000000000000..a88b93ad871a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1436.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1436 : _IssuesUITest + { + public Issue1436(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Button border not drawn on Android without a BorderRadius"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1436Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("TestReady"); + App.Screenshot("I am at Issue 1436"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1469.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1469.cs new file mode 100644 index 000000000000..58a1b93d5618 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1469.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1469 : _IssuesUITest + { + const string Go = "Select 3rd item"; + const string Success = "Success"; + + public Issue1469(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Setting SelectedItem to null inside ItemSelected event handler does not work"; + + [Test] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue1469Test() + { + App.WaitForElement(Go); + App.Tap(Go); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1538.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1538.cs new file mode 100644 index 000000000000..b466b5e2e497 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1538.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1538 : _IssuesUITest + { + public Issue1538(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Crash measuring empty ScrollView"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void MeasuringEmptyScrollViewDoesNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + Task.Delay(1000).Wait(); + App.WaitForElement("Foo"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583.cs new file mode 100644 index 000000000000..b4619c99e267 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1583 : _IssuesUITest + { + public Issue1583(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NavigationPage.TitleIcon broken"; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1583TitleIconTest() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("lblHello"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583_1.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583_1.cs new file mode 100644 index 000000000000..1f1af02646d7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1583_1.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1583_1 : _IssuesUITest + { + public Issue1583_1(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "WebView fails to load from urlwebviewsource with non-ascii characters (works with Uri)"; + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task Issue1583_1_WebviewTest() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("label", "Could not find label", TimeSpan.FromSeconds(10), null, null); + await Task.Delay(TimeSpan.FromSeconds(3)); + App.Screenshot("I didn't crash and i can see Skøyen"); + App.Tap("hashButton"); + await Task.Delay(TimeSpan.FromSeconds(3)); + App.Screenshot("I didn't crash and i can see the GitHub comment #issuecomment-389443737"); + App.Tap("queryButton"); + await Task.Delay(TimeSpan.FromSeconds(3)); + App.Screenshot("I didn't crash and i can see google search for http://microsoft.com"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1590.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1590.cs new file mode 100644 index 000000000000..bb4190fc10d5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1590.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1590 : _IssuesUITest + { + public Issue1590(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView.IsGroupingEnabled results ins ArguementOutOfRangeException"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ListViewIsGroupingEnabledDoesNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("First"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1601.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1601.cs new file mode 100644 index 000000000000..bfdc64545ae4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1601.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1601 : _IssuesUITest + { + public Issue1601(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Exception thrown when `Removing Content Using LayoutCompression"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1601Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("Start G1601"); + App.WaitForElement("CrashButton"); + App.Screenshot("I see the button"); + App.Tap("CrashButton"); + App.Screenshot("Didn't crash!"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1667.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1667.cs new file mode 100644 index 000000000000..eded3c3dfe01 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1667.cs @@ -0,0 +1,58 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1667 : _IssuesUITest + { + public Issue1667(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Entry: Position and color of caret"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void TestCursorPositionAndSelection() + { + App.WaitForElement("CursorTextEntry"); + + App.ClearText("CursorStart"); + App.EnterText("CursorStart", "2"); + App.ClearText("SelectionLength"); + App.EnterText("SelectionLength", "3"); + App.DismissKeyboard(); + App.Tap("Update"); + App.Screenshot("Text selection from char 2 length 3."); + + App.Tap("CursorTextEntry"); + var result = App.WaitForElement("SelectionLength").GetText(); + ClassicAssert.AreEqual("0", result); + } + + [Test] + [Category(UITestCategories.Entry)] + [FailsOnIOS] + public void TestCursorColorOniOS() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("CursorTextEntry"); + App.Tap("Red"); + App.Tap("CursorTextEntry"); + App.Screenshot("Cursor is red."); + + App.Tap("Blue"); + App.Tap("CursorTextEntry"); + App.Screenshot("Cursor is blue."); + + App.Tap("Default"); + App.Tap("CursorTextEntry"); + App.Screenshot("Cursor is default color."); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1683.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1683.cs new file mode 100644 index 000000000000..0c219ba7a9f5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1683.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1683 : _IssuesUITest + { + public Issue1683(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Auto Capitalization Implementation"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue1683Test() + { + App.WaitForElement("Rotation"); + + for (int i = 0; i < 6; i++) + { + App.Tap("Rotation"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1685.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1685.cs new file mode 100644 index 000000000000..4e1876215208 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1685.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1685 : _IssuesUITest + { + const string ButtonId = "Button1685"; + const string Success = "Success"; + + public Issue1685(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Entry clears when upadting text from native with one-way binding"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + public void EntryOneWayBindingShouldUpdate() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(ButtonId); + App.Tap(ButtonId); + App.WaitForNoElement(Success); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1700.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1700.cs new file mode 100644 index 000000000000..9cce2df00a5f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1700.cs @@ -0,0 +1,38 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1700 : _IssuesUITest + { + const string Success = "Success"; + + public Issue1700(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Image fails loading from long URL"; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + App.Back(); + } + + [Test] + [Category(UITestCategories.Image)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void LongImageURLsShouldNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + // Give the images some time to load (or fail) + Task.Delay(3000).Wait(); + + // If we can see this label at all, it means we didn't crash and the test is successful + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1733.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1733.cs new file mode 100644 index 000000000000..c244b2dd3616 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1733.cs @@ -0,0 +1,131 @@ +#nullable disable +using System.Drawing; +using System.Globalization; +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1733 : _IssuesUITest + { + public Issue1733(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Autoresizable Editor"; + + /* + Dictionary _results; + + const string EditorHeightShrinkWithPressureId = "editorHeightShrinkWithPressureId"; + const string EditorHeightGrowId = "editorHeightGrowId"; + const string EditorWidthGrow1Id = "editorWidthGrow1Id"; + const string EditorWidthGrow2Id = "editorWidthGrow2Id"; + const string BtnChangeFontToDefault = "Change the Font to Default"; + const string BtnChangeFontToLarger = "Change the Font to Larger"; + const string BtnChangeToHasText = "Change to Has Text"; + const string BtnChangeToNoText = "Change to Has No Text"; + const string BtnChangeSizeOption = "Change the Size Option"; + + [Test] + [Category(UITestCategories.Editor)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void EditorAutoResize() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + string[] editors = new string[] { EditorHeightShrinkWithPressureId, EditorHeightGrowId, EditorWidthGrow1Id, EditorWidthGrow2Id }; + App.WaitForElement(EditorHeightShrinkWithPressureId); + + _results = new Dictionary(); + + foreach (var editor in editors) + { + _results.Add(editor, GetDimensions(editor)); + } + + App.Tap(BtnChangeToHasText); + App.WaitForElement(BtnChangeToNoText); + TestGrowth(false); + App.Tap(BtnChangeFontToLarger); + App.WaitForElement(BtnChangeFontToDefault); + TestGrowth(true); + + // Reset back to being empty and make sure everything sets back to original size + App.Tap(BtnChangeFontToDefault); + App.Tap(BtnChangeToNoText); + App.WaitForElement(BtnChangeToHasText); + App.WaitForElement(BtnChangeFontToLarger); + + foreach (var editor in editors) + { + var allTheSame = GetDimensions(editor); + ClassicAssert.AreEqual(allTheSame.Width, _results[editor].Width, editor); + ClassicAssert.AreEqual(allTheSame.Height, _results[editor].Height, editor); + } + + // This sets it back to not auto size and we click everything again to see if it grows + App.Tap(BtnChangeSizeOption); + App.Tap(BtnChangeFontToLarger); + App.Tap(BtnChangeToHasText); + App.WaitForElement(BtnChangeFontToDefault); + App.WaitForElement(BtnChangeToNoText); + foreach (var editor in editors) + { + var allTheSame = GetDimensions(editor); + ClassicAssert.AreEqual(allTheSame.Width, _results[editor].Width, editor); + ClassicAssert.AreEqual(allTheSame.Height, _results[editor].Height, editor); + } + } + + void TestGrowth(bool heightPressureShrink) + { + var testSizes = GetDimensions(EditorHeightShrinkWithPressureId); + ClassicAssert.AreEqual(testSizes.Width, _results[EditorHeightShrinkWithPressureId].Width, EditorHeightShrinkWithPressureId); + + if (heightPressureShrink) + ClassicAssert.Less(testSizes.Height, _results[EditorHeightShrinkWithPressureId].Height, EditorHeightShrinkWithPressureId); + else + ClassicAssert.Greater(testSizes.Height, _results[EditorHeightShrinkWithPressureId].Height, EditorHeightShrinkWithPressureId); + + testSizes = GetDimensions(EditorHeightGrowId); + ClassicAssert.AreEqual(testSizes.Width, _results[EditorHeightGrowId].Width, EditorHeightGrowId); + ClassicAssert.Greater(testSizes.Height, _results[EditorHeightGrowId].Height, EditorHeightGrowId); + + var grow1 = GetDimensions(EditorWidthGrow1Id); + ClassicAssert.Greater(grow1.Width, _results[EditorWidthGrow1Id].Width, EditorWidthGrow1Id); + ClassicAssert.Greater(grow1.Height, _results[EditorWidthGrow1Id].Height, EditorWidthGrow1Id); + + var grow2 = GetDimensions(EditorWidthGrow2Id); + ClassicAssert.Greater(grow2.Width, _results[EditorWidthGrow2Id].Width, EditorWidthGrow2Id); + ClassicAssert.Greater(grow2.Height, _results[EditorWidthGrow2Id].Height, EditorWidthGrow2Id); + + // Grow 1 has a lower minimum width request so it's width should be smaller than grow 2 + ClassicAssert.Greater(grow2.Width, grow1.Width, "grow2.Width > grow1.Width"); + } + + Size GetDimensions(string editorName) + { + App.WaitForElement($"{editorName}_height"); + App.WaitForElement($"{editorName}_width"); + + var height = App.WaitForElement($"{editorName}_height").GetText(); + var width = App.WaitForElement($"{editorName}_width").GetText(); + + if (height == null) + { + throw new ArgumentException($"{editorName}_height not found"); + } + if (width == null) + { + throw new ArgumentException($"{editorName}_width not found"); + } + return new Size(Convert.ToInt32(width, CultureInfo.InvariantCulture), Convert.ToInt32(height, CultureInfo.InvariantCulture)); + } + */ + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1747.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1747.cs new file mode 100644 index 000000000000..ca40cafef808 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1747.cs @@ -0,0 +1,38 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1747 : _IssuesUITest + { + const string ToggleButtonAutomationId = nameof(ToggleButtonAutomationId); + const string ToggleSwitchAutomationId = nameof(ToggleSwitchAutomationId); + + public Issue1747(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Binding to Switch.IsEnabled has no effect"; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue1747Test() + { + App.WaitForElement(ToggleButtonAutomationId); + App.WaitForElement(ToggleSwitchAutomationId); + + var toggleSwitch = App.FindElement(ToggleSwitchAutomationId); + ClassicAssert.AreNotEqual(toggleSwitch, null); + + App.Tap(ToggleButtonAutomationId); + + toggleSwitch = App.FindElement(ToggleSwitchAutomationId); + ClassicAssert.AreNotEqual(toggleSwitch, null); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1769.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1769.cs new file mode 100644 index 000000000000..5450ce23460c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1769.cs @@ -0,0 +1,38 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1769 : _IssuesUITest + { + const string GoToPageTwoButtonText = "Go To Page 2"; + const string SwitchAutomatedId = nameof(SwitchAutomatedId); + const string SwitchIsNowLabelTextFormat = "Switch is now {0}"; + + public Issue1769(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "PushAsync with Switch produces NRE"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue1769Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(GoToPageTwoButtonText); + App.Tap(GoToPageTwoButtonText); + + App.WaitForElement(SwitchAutomatedId); + App.WaitForElement(string.Format(SwitchIsNowLabelTextFormat, false)); + App.Tap(SwitchAutomatedId); + App.WaitForElement(string.Format(SwitchIsNowLabelTextFormat, true)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1799.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1799.cs new file mode 100644 index 000000000000..1742834b0ba8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1799.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1799 : _IssuesUITest + { + const string ListView = "ListView1799"; + const string Success = "Success"; + + public Issue1799(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] listView without data crash on ipad."; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ListViewWithoutDataDoesNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + var result = App.WaitForElement(ListView); + var listViewRect = result.GetRect(); + + App.DragCoordinates(listViewRect.CenterX(), listViewRect.Y, listViewRect.CenterX(), listViewRect.Y + 50); + + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue181.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue181.cs new file mode 100644 index 000000000000..df93cd5bcfc1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue181.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue181 : _IssuesUITest + { + public Issue181(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Color not initialized for Label"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + public void Issue181TestsLabelShouldHaveRedText() + { + App.WaitForElement("TestLabel"); + App.Screenshot("Label should have red text"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1851.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1851.cs new file mode 100644 index 000000000000..5a830398b710 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1851.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1851 : _IssuesUITest + { + public Issue1851(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ObservableCollection in ListView gets Index out of range when removing item"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1851Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("btn"); + App.Tap("btn"); + App.WaitForElement("btn"); + App.Tap("btn"); + App.WaitForElement("btn"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1900.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1900.cs new file mode 100644 index 000000000000..360945a03f6e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1900.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1900 : _IssuesUITest + { + public Issue1900(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Xamarin ios ListView ObservableCollection. Collection.Add() throwing 'Index # is greater than the number of rows #' exception"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1900Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("ListView"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1905.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1905.cs new file mode 100644 index 000000000000..09fffcae8dfe --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1905.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1905 : _IssuesUITest + { + public Issue1905(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "AlertView doesn't scroll when text is to large"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.DisplayAlert)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void TestIssue1905RefreshShows() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + // wait for test to load + App.WaitForElement("btnRefresh"); + App.Screenshot("Should show refresh control"); + + // wait for test to finish so it doesn't keep working + // in the background and break the next test + App.WaitForElement("data refreshed"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1908.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1908.cs new file mode 100644 index 000000000000..b31a28b1be03 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1908.cs @@ -0,0 +1,26 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1908 : _IssuesUITest + { + public Issue1908(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Image reuse"; + + [Test] + [Category(UITestCategories.Image)] + [Category(UITestCategories.Compatibility)] + public void Issue1908Test() + { + App.WaitForElement("OASIS1"); + App.Screenshot("For manual review. Images load"); + } + } +} +#endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1909.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1909.cs new file mode 100644 index 000000000000..9b8d77ab7d84 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1909.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1909 : _IssuesUITest + { + public Issue1909(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Xamarin.forms 2.5.0.280555 and android circle button issue"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue1909Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("I am at Issue 1909"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1931.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1931.cs new file mode 100644 index 000000000000..04d9e92a3600 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1931.cs @@ -0,0 +1,36 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1931 : _IssuesUITest + { + const string Go = "Go"; + const string Back = "GoBack"; + const string Success = "Success"; + + public Issue1931(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Xamarin Forms on Android: ScrollView on ListView header crashes app when closing page"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + public void ScrollViewInHeaderDisposesProperly() + { + App.WaitForElement(Go); + App.Tap(Go); + + App.WaitForElement(Back); + App.Tap(Back); + + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1937.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1937.cs new file mode 100644 index 000000000000..9480fbd19b42 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1937.cs @@ -0,0 +1,39 @@ +#if WINDOWS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1937 : _IssuesUITest + { + public Issue1937(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] Choppy animation"; + + [Test] + [Category(UITestCategories.Animation)] + [Category(UITestCategories.Compatibility)] + public void Issue1937Test() + { + App.Tap("FAST_TIMER"); + App.WaitForElement("COMPLETE", timeout: TimeSpan.FromSeconds(2)); + var result = App.WaitForElement("RESULT"); + int.TryParse(result.GetText(), out int timerTicks1); + + //If fps > 50 then result must be 50. For small fps we use comparing with 35. + ClassicAssert.IsTrue(timerTicks1 > 35, $"Expected timer ticks are greater than 35. Actual: {timerTicks1}"); + + App.Tap("SLOW_TIMER"); + App.WaitForElement("COMPLETE", timeout: TimeSpan.FromSeconds(2)); + result = App.WaitForElement("RESULT"); + int.TryParse(result.GetText(), out int timerTicks2); + + ClassicAssert.IsTrue(timerTicks2 < 11, $"Expected timer ticks are less than 11. Actual: {timerTicks2}"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1942.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1942.cs new file mode 100644 index 000000000000..aa80e0709ca8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1942.cs @@ -0,0 +1,28 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1942 : _IssuesUITest + { + const string ClickMeString = "CLICK ME"; + + public Issue1942(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Attached Touch Listener events do not dispatch to immediate parent Grid Renderer View on Android when Child fakes handled"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void ClickPropagatesToOnTouchListener() + { + App.Tap(ClickMeString); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1975.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1975.cs new file mode 100644 index 000000000000..03eeb1794c04 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue1975.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue1975 : _IssuesUITest + { + const string Success = "If you can see this, the test has passed"; + const string Go = "Go"; + + public Issue1975(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] ListView throws NRE when grouping enabled and data changed"; + public override bool ResetMainPage => false; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + App.Back(); + } + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ClickPropagatesToOnTouchListener() + { + App.Tap(Go); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2004.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2004.cs new file mode 100644 index 000000000000..7b6fc5f5caba --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2004.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2004 : _IssuesUITest + { + public Issue2004(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void NoCrashFromDisposedBitmapWhenSwitchingPages() + { + App.WaitForNoElement("Success", timeout: TimeSpan.FromSeconds(20)); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2035.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2035.cs new file mode 100644 index 000000000000..85495853021e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2035.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2035 : _IssuesUITest + { + const string Success = "Success"; + + public Issue2035(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "App crashes when setting CurrentPage on TabbedPage in ctor in 2.5.1pre1"; + + [Test] + [Category(UITestCategories.TabbedPage)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2035Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(Success); + //if it doesn't crash, we're good. + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2222.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2222.cs new file mode 100644 index 000000000000..ff814bc2fa1a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2222.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2222 : _IssuesUITest + { + public Issue2222(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NavigationBar.ToolbarItems.Add() crashes / breaks app in iOS7. works fine in iOS8"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void TestItDoesntCrashWithWrongIconName() + { + App.WaitForElement("TestLabel"); + App.Screenshot("Was label on page shown"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2241.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2241.cs new file mode 100644 index 000000000000..41bbb4ba322a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2241.cs @@ -0,0 +1,33 @@ +#if IOS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2241 : _IssuesUITest + { + public Issue2241(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ScrollView content can become stuck on orientation change (iOS)"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + public void ChangeOrientationCheckScroll() + { + var grid1 = App.FindElement("MainGrid").GetRect(); + App.SetOrientationLandscape(); + App.ScrollDown("TestScrollView", ScrollStrategy.Programmatically); + App.SetOrientationPortrait(); + var grid2 = App.FindElement("MainGrid").GetRect(); + App.Screenshot("Did it resize ok? Do you see some white on the bottom?"); + + ClassicAssert.AreEqual(grid1.CenterY(), grid2.CenterY()); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2259.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2259.cs new file mode 100644 index 000000000000..6bb0fa3551af --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2259.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2259 : _IssuesUITest + { + public Issue2259(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView.ScrollTo crashes app"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2259Tests() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac]); + + for (int i = 0; i < 20; i++) + { + App.Tap("AddButton"); + App.WaitForElement("Name " + (i + 1).ToString()); + App.Screenshot("Added Cell"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2339.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2339.cs new file mode 100644 index 000000000000..42a88ce28d4b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2339.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2339 : _IssuesUITest + { + public Issue2339(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Picker not shown when .Focus() is called"; + + [Test] + [Category(UITestCategories.Picker)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void FocusAndUnFocusMultipleTimes() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows], "Focus Behavior is different"); + + App.WaitForElement("btnFocusThenUnFocus"); + App.Tap("btnFocusThenUnFocus"); + App.WaitForNoElement("Picker Focused: 1"); + App.WaitForNoElement("Picker UnFocused: 1"); + App.Back(); + App.Tap("btnFocusThenUnFocus"); + App.WaitForNoElement("Picker Focused: 2"); + App.WaitForNoElement("Picker UnFocused: 2"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2354.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2354.cs new file mode 100644 index 000000000000..35ba36ad85b9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2354.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2354 : _IssuesUITest + { + public Issue2354(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView, ImageCell and disabled source cache and same image url"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void TestDoesntCrashWithCachingDisable() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("ImageLoaded"); + App.ScrollDown("TestListView", ScrollStrategy.Programmatically); + App.ScrollDown("TestListView", ScrollStrategy.Programmatically); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2399.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2399.cs new file mode 100644 index 000000000000..7ebe33c4fa49 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2399.cs @@ -0,0 +1,34 @@ +#if IOS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2399 : _IssuesUITest + { + const string AllEventsHaveDetached = "AllEventsHaveDetached"; + + public Issue2399(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Label Renderer Dispose never called"; + + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void WaitForAllEffectsToDetach() + { + App.WaitForElement(AllEventsHaveDetached); + var text = App.FindElement(AllEventsHaveDetached).GetText(); + ClassicAssert.NotNull(text); + ClassicAssert.AreEqual("Success", text); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24574.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24574.cs new file mode 100644 index 000000000000..759fdd022d6d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24574.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue24574 : _IssuesUITest + { + public Issue24574(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Tap Double Tap"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + public void TapThenDoubleTap() + { + App.Screenshot("I am at Issue 24574"); + + App.WaitForElement("TapLabel"); + + App.Tap("TapLabel"); + App.WaitForNoElement("Single"); + + App.DoubleClick("TapLabel"); + App.WaitForNoElement("Double"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2482.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2482.cs new file mode 100644 index 000000000000..918f45dd2008 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2482.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2482 : _IssuesUITest + { + const string ButtonId = "SpinButton"; + const string Success = "Success"; + + public Issue2482(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Animating a `View` that is currently animating will throw `System.InvalidOperationException`"; + + [Test] + [Category(UITestCategories.Animation)] + [Category(UITestCategories.Compatibility)] + public void AnimationCancel() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(ButtonId); + App.DoubleClick(ButtonId); + App.WaitForNoElement(Success, timeout: TimeSpan.FromSeconds(25)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2617.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2617.cs new file mode 100644 index 000000000000..f9b4f75f5385 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2617.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2617 : _IssuesUITest + { + const string Success = "Success"; + + public Issue2617(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Error on binding ListView with duplicated items"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public async Task BindingToValuesTypesAndScrollingNoCrash() + { + await Task.Delay(4000); + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2653.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2653.cs new file mode 100644 index 000000000000..e318edd2f260 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2653.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2653 : _IssuesUITest + { + const string ButtonText = "Insert Box View"; + const string TestForButtonClicked = "Test For Clicked"; + const string Success = "BoxView Not Overlapping"; + + public Issue2653(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] Grid insert z-order on UWP broken in Forms 3"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ZIndexWhenInsertingChildren() + { + App.WaitForNoElement(ButtonText); + App.Tap(ButtonText); + App.Tap(ButtonText); + App.Tap(TestForButtonClicked); + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2674.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2674.cs new file mode 100644 index 000000000000..078ba57bbb8f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2674.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2674 : _IssuesUITest + { + public Issue2674(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Exception occurs when giving null values in picker itemsource collection"; + + [Test] + [Category(UITestCategories.Picker)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2674Test() + { + App.Screenshot("I am at Issue2674"); + App.WaitForElement("picker"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2680ScrollView.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2680ScrollView.cs new file mode 100644 index 000000000000..b87c7d30be5a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2680ScrollView.cs @@ -0,0 +1,45 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2680ScrollView : _IssuesUITest + { + const string ScrollViewMark = "ScrollView"; + const string FirstItemMark = "FirstItem"; + const string ToggleButtonMark = "ToggleButton"; + + public Issue2680ScrollView(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Enhancement] Add VerticalScrollMode/HorizontalScrollMode to ListView and ScrollView"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue2680Test_ScrollDisabled() + { + App.ScrollDown(ScrollViewMark); + App.ScrollDown(ScrollViewMark); + + App.WaitForElement(FirstItemMark, timeout: TimeSpan.FromSeconds(5)); + } + + [Test] + [Category(UITestCategories.ScrollView)] + [FailsOnIOS] + public void Issue2680Test_ScrollEnabled() + { + App.Tap(ToggleButtonMark); + + App.ScrollDown(ScrollViewMark); + App.ScrollDown(ScrollViewMark); + + App.WaitForNoElement(FirstItemMark, timeout: TimeSpan.FromSeconds(5)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2681.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2681.cs new file mode 100644 index 000000000000..c24e5a04db11 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2681.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2681 : _IssuesUITest + { + const string NavigateToPage = "Click Me."; + + public Issue2681(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] Label inside Listview gets stuck inside infinite loop"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + public void ListViewDoesntFreezeApp() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.Tap(NavigateToPage); + App.WaitForNoElement("3"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2728.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2728.cs new file mode 100644 index 000000000000..8a4199aea960 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2728.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2728 : _IssuesUITest + { + const string LabelHome = "Hello Label"; + + public Issue2728(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[macOS] Label FontAttributes Italic is not working"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2728TestsItalicLabel() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Windows]); + + App.WaitForNoElement(LabelHome); + App.Screenshot("Label rendered with italic font"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2775.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2775.cs new file mode 100644 index 000000000000..199a4cb37500 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2775.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2775 : _IssuesUITest + { + public Issue2775(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ViewCell background conflicts with ListView Semi-Transparent and Transparent backgrounds"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2775Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("I am at Issue 2775"); + App.Screenshot("I see the Label"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2777.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2777.cs new file mode 100644 index 000000000000..226d23a614fb --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2777.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2777 : _IssuesUITest + { + public Issue2777(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "When add GroupHeaderTemplate in XAML the group header does not show up"; + + [Test] + [Category(UITestCategories.CollectionView)] + [FailsOnIOS] + public void Issue2777Test() + { + App.Screenshot("I am at Issue 2965"); + App.WaitForNoElement("The letter A"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2829.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2829.cs new file mode 100644 index 000000000000..add7a32da39f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2829.cs @@ -0,0 +1,36 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2829 : _IssuesUITest + { + const string kScrollMe = "kScrollMe"; + const string kSuccess = "SUCCESS"; + const string kCreateListViewButton = "kCreateListViewButton"; + + public Issue2829(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Renderers associated with ListView cells are occasionaly not being disposed of which causes left over events to propagate to disposed views"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void ViewCellsAllDisposed() + { + App.Tap(kCreateListViewButton); + App.WaitForNoElement("0"); + App.Tap(kScrollMe); + App.WaitForNoElement("70"); + App.Back(); + App.WaitForElement(kSuccess); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2837.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2837.cs new file mode 100644 index 000000000000..389dbbc87a28 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2837.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2837 : _IssuesUITest + { + const string Success = "worked"; + + public Issue2837(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Exception thrown during NavigationPage.Navigation.PopAsync"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void Issue2837Test() + { + App.WaitForElement(Success); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2842.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2842.cs new file mode 100644 index 000000000000..3eff1c93693a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2842.cs @@ -0,0 +1,28 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2842 : _IssuesUITest + { + public Issue2842(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ViewCell in TableView not adapting to changed size on iOS"; + + [Test] + [Category(UITestCategories.TabbedPage)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue2842Test() + { + App.WaitForElement("btnClick"); + App.Tap("btnClick"); + App.Screenshot("Verify that the text is not on top of the image"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2858.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2858.cs new file mode 100644 index 000000000000..6fd5b623783b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2858.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2858 : _IssuesUITest + { + const string Success = "Success"; + const string InnerGrid = "InnerGrid"; + const string OuterGrid = "OuterGrid"; + + public Issue2858(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Transparency Cascading"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void CascadeInputTransparentGrids() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(InnerGrid); + App.Tap(InnerGrid); + + var green = App.WaitForElement(OuterGrid).GetRect(); + App.TapCoordinates(green.CenterX(), green.Y + 20); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2929.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2929.cs new file mode 100644 index 000000000000..7bc75f581164 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2929.cs @@ -0,0 +1,45 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2929 : _IssuesUITest + { + const string Success = "Success"; + const string Go = "Go"; + + public Issue2929(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] ListView with null ItemsSource crashes on 3.0.0.530893"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void NullItemSourceDoesNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac]); + + // If we can see the Success label, it means we didn't crash. + App.WaitForElement(Success); + } + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void SettingItemsSourceToNullDoesNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac]); + + App.WaitForElement(Go); + App.Tap(Go); + + // If we can see the Success label, it means we didn't crash. + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2963.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2963.cs new file mode 100644 index 000000000000..6733bbdbd38f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2963.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2963 : _IssuesUITest + { + readonly string EditorId = "DisabledEditor"; + readonly string FocusedLabelId = "FocusedLabel"; + + public Issue2963(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Disabling Editor in iOS does not disable entry of text"; + + [Test] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue2963Test() + { + App.Screenshot("I am at Issue 2963"); + App.Tap(EditorId); + ClassicAssert.AreEqual("False", App.FindElement(FocusedLabelId).GetText()); + App.Screenshot("Label should still be false"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2983.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2983.cs new file mode 100644 index 000000000000..4c653b818856 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue2983.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue2983 : _IssuesUITest + { + public Issue2983(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView.Footer can cause NullReferenceException"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void TestDoesNotCrash() + { + App.WaitForElement("footer"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3000.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3000.cs new file mode 100644 index 000000000000..1c59467c6e8d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3000.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3000 : _IssuesUITest + { + const string Success = "Success"; + + public Issue3000(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Horizontal ScrollView breaks scrolling when flowdirection is set to rtl"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void RtlScrollViewStartsScrollToRight() + { + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3001.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3001.cs new file mode 100644 index 000000000000..e26c2b8827e9 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3001.cs @@ -0,0 +1,30 @@ +#if MACCATALYST +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3001 : _IssuesUITest + { + const string ButtonId = "ClearButton"; + const string ReadyId = "ReadyLabel"; + + public Issue3001(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[macOS] Navigating back from a complex page is highly inefficient"; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void Issue3001Test() + { + App.WaitForElement(ButtonId); + App.Tap(ButtonId); + App.WaitForElement(ReadyId, timeout: TimeSpan.FromSeconds(5)); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3049.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3049.cs new file mode 100644 index 000000000000..39b3decc8585 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3049.cs @@ -0,0 +1,45 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3049 : _IssuesUITest + { + const string Button1Id = "button1"; + const string Button2Id = "button2"; + const string LabelId = "label"; + const string Success = "Success"; + const string Action1 = "Don't click me"; + + public Issue3049(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "DisplayActionSheet freezes app in iOS custom renderer (iPad only)"; + + [Test] + [Category(UITestCategories.DisplayAlert)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task Issue3049Test() + { + App.WaitForElement(Button1Id); + + App.Tap(Button1Id); + + await Task.Delay(500); + //App.WaitForElement(Action1); + + // Tap outside ActionSheet to dismiss it + App.Tap(LabelId); + + App.WaitForElement(Button2Id); + App.Tap(Button2Id); + + App.WaitForElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3087.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3087.cs new file mode 100644 index 000000000000..99e9da7647de --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3087.cs @@ -0,0 +1,25 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3087 : _IssuesUITest + { + public Issue3087(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Non appcompat SwitchRenderer regression between 3.0 and 3.1"; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + public void NonAppCompatBasicSwitchTest() + { + App.WaitForNoElement("Success"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3089.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3089.cs new file mode 100644 index 000000000000..f1d801be9423 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3089.cs @@ -0,0 +1,32 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3089 : _IssuesUITest + { + const string Reload = "reload"; + const string Success = "success"; + + public Issue3089(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "TextCell text doesn't change when using Recycling on ListViews"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ResettingItemsOnRecycledListViewKeepsOldText() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.Tap(Reload); + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3262.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3262.cs new file mode 100644 index 000000000000..5975cf718aef --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3262.cs @@ -0,0 +1,109 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3262 : _IssuesUITest + { + public Issue3262(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Adding Cookies ability to a WebView..."; + + [Test] + [Category(UITestCategories.WebView)] + [FailsOnAndroid] + public void LoadingPageWithoutCookiesSpecifiedDoesntCrash() + { + App.Tap("PageWithoutCookies"); + App.WaitForElement("PageWithoutCookies"); + } + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ChangeDuringNavigating() + { + App.WaitForElement("Loaded"); + // add a couple cookies + App.Tap("ChangeDuringNavigating"); + ValidateSuccess(); + App.Tap("ChangeDuringNavigating"); + ValidateSuccess(); + } + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void AddAdditionalCookieToWebView() + { + App.WaitForElement("Loaded"); + // add a couple cookies + App.Tap("AdditionalCookie"); + ValidateSuccess(); + App.Tap("AdditionalCookie"); + ValidateSuccess(); + } + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void SetToOneCookie() + { + App.WaitForElement("Loaded"); + App.Tap("OneCookie"); + ValidateSuccess(); + } + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void SetCookieContainerToNullDisablesCookieManagement() + { + App.WaitForElement("Loaded"); + // add a cookie to verify said cookie remains + App.Tap("AdditionalCookie"); + ValidateSuccess(); + App.Tap("NullAllCookies"); + ValidateSuccess(); + } + + [Test] + [Category(UITestCategories.WebView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void RemoveAllTheCookiesIAdded() + { + App.WaitForElement("Loaded"); + // add a cookie so you can remove a cookie + App.Tap("AdditionalCookie"); + ValidateSuccess(); + App.Tap("EmptyAllCookies"); + ValidateSuccess(); + } + + void ValidateSuccess() + { + try + { + App.WaitForElement("Success"); + } + catch + { + App.Tap("DisplayAllCookies"); + throw; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3273.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3273.cs new file mode 100644 index 000000000000..4adf69d127f4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3273.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3273 : _IssuesUITest + { + public Issue3273(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Drag and drop reordering not firing CollectionChanged"; + + [Test] + [Category(UITestCategories.Gestures)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue3273Test() + { + App.WaitForElement("Move items"); + App.Tap("Move items"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3275.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3275.cs new file mode 100644 index 000000000000..c93e62e2346e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3275.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3275 : _IssuesUITest + { + readonly string BtnLeakId = "btnLeak"; + readonly string BtnScrollToId = "btnScrollTo"; + + public Issue3275(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "For ListView in Recycle mode ScrollTo causes cell leak and in some cases NRE"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3275Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(BtnLeakId); + App.Tap(BtnLeakId); + App.WaitForElement(BtnScrollToId); + App.Tap(BtnScrollToId); + App.Back(); + App.WaitForElement(BtnLeakId); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3333.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3333.cs new file mode 100644 index 000000000000..690497bb29e0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3333.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3333 : _IssuesUITest + { + const string KSuccess = "If you're reading this the test has passed"; + + public Issue3333(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] with ListView on page, Navigation.PopAsync() throws exception"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void SettingBindingContextToNullBeforingPoppingPageCrashes() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement(KSuccess); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3342.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3342.cs new file mode 100644 index 000000000000..3981f318749f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3342.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3342 : _IssuesUITest + { + public Issue3342(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] BoxView BackgroundColor not working on 3.2.0-pre1"; + + [Test] + [Category(UITestCategories.BoxView)] + [Category(UITestCategories.Compatibility)] + public void Issue3342Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.Screenshot("I am at Issue 3342"); + App.Screenshot("I see the green box"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3385.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3385.cs new file mode 100644 index 000000000000..0d49b910458b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3385.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3385 : _IssuesUITest + { + public Issue3385(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Entry's TextChanged event is fired on Unfocus even when no text changed"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3385Test() + { + App.WaitForElement("entry"); + App.Tap("entry"); + App.WaitForElement("click"); + App.Tap("click"); + App.WaitForNoElement("FAIL"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3390.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3390.cs new file mode 100644 index 000000000000..ef49025a4b98 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3390.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3390 : _IssuesUITest + { + public Issue3390(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Crash/incorrect behavior with corner radius 5"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3390Test() + { + App.Tap("TestButton"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3413.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3413.cs new file mode 100644 index 000000000000..fe208492ff8c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3413.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3413 : _IssuesUITest + { + public Issue3413(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Searchbar in Horizontal Stacklayout doesn't render"; + + [Test] + [Category(UITestCategories.SearchBar)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue3413Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("srb_vertical"); + App.WaitForElement("srb_horizontal"); + App.Screenshot("Please verify we have 2 SearchBars. One below the label, other side by side with the label"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue342.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue342.cs new file mode 100644 index 000000000000..d04e6ebea622 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue342.cs @@ -0,0 +1,48 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue342NoSource : _IssuesUITest + { + public Issue342NoSource(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NRE when Image is not assigned source"; + + [Test] + [Category(UITestCategories.Page)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue342NoSourceTestsLablePresentNoImage() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForNoElement("Uninitialized image", "Cannot see label"); + App.Screenshot("All elements present"); + } + } + + + public class Issue342DelayedSource : _IssuesUITest + { + public Issue342DelayedSource(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NRE when Image is delayed source"; + + [Test] + [Category(UITestCategories.Page)] + [FailsOnIOS] + public void Issue342DelayedLoadTestsImageLoads() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForElement("TestReady"); + App.Screenshot("Should not crash"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3507.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3507.cs new file mode 100644 index 000000000000..57cd2a1cdd9e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3507.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3507 : _IssuesUITest + { + const string Success = "Success"; + + public Issue3507(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] Scrollview with null content crashes on UWP"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void NullContentOnScrollViewDoesntCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForNoElement(Success); + //if it doesn't crash, we're good. + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3548.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3548.cs new file mode 100644 index 000000000000..d7dd264bd0af --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3548.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3548 : _IssuesUITest + { + const string SuccessMessage = "EFFECT IS ATTACHED!"; + + public Issue3548(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Cannot attach effect to Frame"; + + [Test] + [Category(UITestCategories.Frame)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void CheckIsEffectAttached() + { + App.WaitForNoElement(SuccessMessage); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3667.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3667.cs new file mode 100644 index 000000000000..b84b10cfc551 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3667.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3667 : _IssuesUITest + { + string text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; + + public Issue3667(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Enhancement] Add text-transforms to Label"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3667Tests() + { + App.WaitForNoElement(text); + App.Tap("ChangeTextTransformButton"); + App.WaitForNoElement(text); + App.Tap("ChangeTextTransformButton"); + App.WaitForNoElement(text.ToLowerInvariant()); + App.Tap("ChangeTextTransformButton"); + App.WaitForNoElement(text.ToUpperInvariant()); + App.Tap("ChangeTextTransformButton"); + App.WaitForNoElement(text); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3884.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3884.cs new file mode 100644 index 000000000000..71fd2cd6678b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue3884.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue3884 : _IssuesUITest + { + public Issue3884(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "BoxView corner radius"; + + [Test] + [Category(UITestCategories.BoxView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3884Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("TestReady"); + App.Screenshot("I see a blue circle"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue417.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue417.cs new file mode 100644 index 000000000000..25b15695bc08 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue417.cs @@ -0,0 +1,44 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue417 : _IssuesUITest + { + public Issue417(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Navigation.PopToRootAsync does nothing"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + public void Issue417TestsNavigateAndPopToRoot() + { + App.WaitForElement("FirstPage"); + App.WaitForElement("NextPage"); + App.Screenshot("All elements present"); + + App.Tap("NextPage"); + + App.WaitForElement("SecondPage"); + App.WaitForElement("NextPage2"); + App.Screenshot("At second page"); + App.Tap("NextPage2"); + + App.WaitForElement("ThirdPage"); + App.WaitForElement("PopToRoot"); + App.Screenshot("At third page"); + App.Tap("PopToRoot"); + + App.WaitForElement("FirstPage"); + App.WaitForElement("NextPage"); + App.Screenshot("All elements present"); + + App.Screenshot("Popped to root"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4484.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4484.cs new file mode 100644 index 000000000000..af3cc8de3452 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4484.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue4484 : _IssuesUITest + { + public Issue4484(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] ImageButton inside NavigationView.TitleView throw exception during device rotation"; + public override bool ResetMainPage => false; + + protected override void FixtureTeardown() + { + base.FixtureTeardown(); + App.SetOrientationPortrait(); + } + + [Test] + [Category(UITestCategories.ImageButton)] + [Category(UITestCategories.Compatibility)] + public void RotatingDeviceDoesntCrashTitleView() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("Instructions"); + App.SetOrientationLandscape(); + App.WaitForElement("Instructions"); + App.SetOrientationPortrait(); + App.WaitForElement("Instructions"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4600.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4600.cs new file mode 100644 index 000000000000..989c487dc298 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4600.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue4600 : _IssuesUITest + { + public Issue4600(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] CollectionView crash with empty ObservableCollection"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void InitiallyEmptySourceDisplaysAddedItem() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("Insert"); + App.Tap("btnInsert"); + App.WaitForNoElement("Inserted"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue465.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue465.cs new file mode 100644 index 000000000000..d7a632bb315e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue465.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue465 : _IssuesUITest + { + public Issue465(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Change in Navigation.PushModal"; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Issue465TestsPushPopModal() + { + App.WaitForElement("PopPage"); + App.Screenshot("All elements exist"); + + App.Tap("PopPage"); + App.WaitForElement("Popppppped"); + App.Screenshot("Popped modal successful"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4782.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4782.cs new file mode 100644 index 000000000000..1db6fb2181b7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4782.cs @@ -0,0 +1,27 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue4782 : _IssuesUITest + { + const string Success = "Success"; + + public Issue4782(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Null drawable crashes Image Button"; + + [Test] + [Category(UITestCategories.ImageButton)] + [Category(UITestCategories.Compatibility)] + public void ImageButtonNullDrawable() + { + App.WaitForElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4879.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4879.cs new file mode 100644 index 000000000000..cee1bae9bde8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue4879.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue4879 : _IssuesUITest + { + public Issue4879(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "4879 - ImageButtonPadding"; + + [Test] + [Category(UITestCategories.ImageButton)] + [Category(UITestCategories.Compatibility)] + public void Issue4879Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("I am at Issue 4879. All buttons or images should be the same size."); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue488.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue488.cs new file mode 100644 index 000000000000..385d5e64b5aa --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue488.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue488 : _IssuesUITest + { + public Issue488(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Resizing the Label results in wrapped text being cropped on iOS"; + + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnAllPlatforms] + public void Issue488TestsLongTextRotation() + { + App.WaitForNoElement("I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text."); + App.SetOrientationLandscape(); + App.Screenshot("Resize Label.Text by rotating to landscape"); + App.WaitForNoElement("I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text. I am a long bit of text."); + App.Screenshot("Entire Label.Text present"); + App.SetOrientationPortrait(); + App.Screenshot("Rotated back to portrait"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5239.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5239.cs new file mode 100644 index 000000000000..1dc5d0a0d93c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5239.cs @@ -0,0 +1,28 @@ +#if IOS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5239 : _IssuesUITest + { + public Issue5239(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Top Padding not working on iOS when it is set alone"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void PaddingEqualToSafeAreaWorks() + { + var somePadding = App.WaitForElement("Hello").GetRect(); + ClassicAssert.AreEqual(20f, somePadding.Y); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5367.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5367.cs new file mode 100644 index 000000000000..9c650abbcdea --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5367.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5367 : _IssuesUITest + { + const string MaxLengthEditor = "MaxLength Editor"; + const string ForceBigStringButton = "Force Big String Button"; + + public Issue5367(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Editor with MaxLength"; + + [Test] + [Category(UITestCategories.Editor)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue3390Test() + { + App.WaitForElement(MaxLengthEditor); + App.Tap(ForceBigStringButton); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5376.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5376.cs new file mode 100644 index 000000000000..d05f28e0aa7c --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5376.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5376 : _IssuesUITest + { + public Issue5376(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Call unfocus entry crashes app"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + public void Issue5376Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement("Success"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5461.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5461.cs new file mode 100644 index 000000000000..bd0464b65c3a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5461.cs @@ -0,0 +1,27 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5461 : _IssuesUITest + { + const string Success = "If you can see this, the test has passed"; + + public Issue5461(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] ScrollView crashes when setting ScrollbarFadingEnabled to false in Custom Renderer"; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + public void ScrollViewWithScrollbarFadingEnabledFalseDoesntCrash() + { + App.WaitForNoElement(Success); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5535.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5535.cs new file mode 100644 index 000000000000..e7151a1b48dc --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5535.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5535 : _IssuesUITest + { + public Issue5535(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "CollectionView: Swapping EmptyViews has no effect"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void SwappingEmptyViews() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("FilterItems"); + App.Tap("FilterItems"); + App.EnterText("FilterItems", "abcdef"); + + // Default empty view + App.WaitForNoElement("Nothing to see here."); + + App.Tap("ToggleEmptyView"); + + // Other empty view + App.WaitForNoElement("No results matched your filter."); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5765.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5765.cs new file mode 100644 index 000000000000..3f1cb8f8f00e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5765.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5765 : _IssuesUITest + { + const string Target = "FirstLabel"; + + public Issue5765(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Frame, CollectionView, Android]The Label.Text is invisible on Android if DataTemplate have frame as layout"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void FlexLayoutsInFramesShouldSizeCorrectly() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + // If the first label is visible at all, then this has succeeded + App.WaitForElement(Target); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5830.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5830.cs new file mode 100644 index 000000000000..583d0b4ce365 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5830.cs @@ -0,0 +1,27 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5830 : _IssuesUITest + { + public Issue5830(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Enhancement] EntryCellTableViewCell should be public"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue5830Test() + { + App.WaitForElement("TestReady"); + App.Screenshot("EntryTableViewCell Test with custom Text and TextColor"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5951.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5951.cs new file mode 100644 index 000000000000..439ad54b45e1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5951.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue5951 : _IssuesUITest + { + public Issue5951(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "App Crashes On Shadow Effect's OnDetached On Button That's Never Visible"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue5951Test() + { + App.Tap("Push page"); + App.WaitForElement("Push page"); + App.WaitForNoElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6260.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6260.cs new file mode 100644 index 000000000000..6c4f2ae4af4f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6260.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6260 : _IssuesUITest + { + const string Text = "If this number keeps increasing test has failed: "; + readonly string success = Text + "0"; + + public Issue6260(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] infinite layout loop"; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void NonAppCompatBasicSwitchTest() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6262.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6262.cs new file mode 100644 index 000000000000..7b4640632e35 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6262.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6262 : _IssuesUITest + { + public Issue6262(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Button in Grid gets wrong z-index"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ImageShouldLayoutOnTopOfButton() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("ClickMe"); + App.Tap("ClickMe"); + App.WaitForElement("ClickMe"); + App.WaitForNoElement("Fail"); + App.Tap("RetryTest"); + App.WaitForElement("ClickMe"); + App.Tap("ClickMe"); + App.WaitForElement("ClickMe"); + App.WaitForNoElement("Fail"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6368.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6368.cs new file mode 100644 index 000000000000..b408648797ee --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6368.cs @@ -0,0 +1,30 @@ +#if iOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6368 : _IssuesUITest + { + public Issue6368(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[CustomRenderer]Crash when navigating back from page with custom renderer control"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue6368Test() + { + App.WaitForElement("btnGo"); + App.Tap("btnGo"); + App.WaitForElement("GoToNextPage"); + App.Back(); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6458.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6458.cs new file mode 100644 index 000000000000..d55aba937ce4 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6458.cs @@ -0,0 +1,34 @@ +#if ANDROID +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6458 : _IssuesUITest + { + public Issue6458(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Fix load TitleIcon on non app compact"; + + [Test] + [Category(UITestCategories.Navigation)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Issue6458Test() + { + App.WaitForElement("IssuePageLabel"); + var element = App.WaitForElement("banktitleicon"); + + ClassicAssert.NotNull(element); + + var elementRect = element.GetRect(); + ClassicAssert.Greater(elementRect.Height, 10); + ClassicAssert.Greater(elementRect.Width, 10); + } + } +} +#endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6472.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6472.cs new file mode 100644 index 000000000000..8c69d71aec72 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6472.cs @@ -0,0 +1,40 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6472 : _IssuesUITest + { + const string ListViewAutomationId = "TheListview"; + const string ClearButtonAutomationId = "ClearButton"; + const string UiThreadButtonAutomationId = "UiThreadButton"; + const string OtherThreadButtonAutomationId = "OtherThreadButton"; + + public Issue6472(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug][iOS] listview / observable collection throwing native error on load"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [Ignore("Fails occasionally on iOS 12 https://github.com/xamarin/Xamarin.Forms/issues/6472")] + public void ListViewDoesNotThrowExceptionWithObservableCollection() + { + App.WaitForElement(ListViewAutomationId); + App.Screenshot("We got here without an exception while loading the data and data is visible"); + + App.Tap(ClearButtonAutomationId); + App.Tap(UiThreadButtonAutomationId); + App.Tap(OtherThreadButtonAutomationId); + + App.Tap(ClearButtonAutomationId); + App.Tap(OtherThreadButtonAutomationId); + App.Tap(UiThreadButtonAutomationId); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6705.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6705.cs new file mode 100644 index 000000000000..7b095ecb2fe2 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6705.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6705 : _IssuesUITest + { + public Issue6705(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "InvokeOnMainThreadAsync throws NullReferenceException"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue6705Test() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + for (var i = 1; i < 6; i++) + { + App.WaitForElement($"Button{i}"); + App.Tap($"Button{i}"); + App.WaitForNoElement($"{i}"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6932.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6932.cs new file mode 100644 index 000000000000..3b30868a5831 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6932.cs @@ -0,0 +1,53 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6932 : _IssuesUITest + { + const string LayoutAutomationId = "StackLayoutThing"; + const string AddAutomationId = "AddButton"; + const string ClearAutomationId = "ClearButton"; + const string EmptyViewAutomationId = "EmptyViewId"; + + public Issue6932(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "EmptyView for BindableLayout (view)"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void EmptyViewBecomesVisibleWhenItemsSourceIsCleared() + { + App.Screenshot("Screen opens, items are shown"); + + App.WaitForElement(LayoutAutomationId); + App.Tap(ClearAutomationId); + App.WaitForElement(EmptyViewAutomationId); + + App.Screenshot("Empty view is visible"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + [FailsOnIOS] + public void EmptyViewHidesWhenItemsSourceIsFilled() + { + App.Screenshot("Screen opens, items are shown"); + + App.WaitForElement(LayoutAutomationId); + App.Tap(ClearAutomationId); + App.WaitForElement(EmptyViewAutomationId); + + App.Screenshot("Items are cleared, empty view visible"); + + App.Tap(AddAutomationId); + App.WaitForNoElement(EmptyViewAutomationId); + + App.Screenshot("Item is added, empty view is not visible"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6945.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6945.cs new file mode 100644 index 000000000000..fef3d4c8db6f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6945.cs @@ -0,0 +1,35 @@ +#if IOS +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6945 : _IssuesUITest + { + const string ClickMeId = "ClickMeAutomationId"; + const string BoxViewId = "BoxViewAutomationId"; + + public Issue6945(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Wrong anchor behavior when setting HeightRequest "; + + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void WrongTranslationBehaviorWhenChangingHeightRequestAndSettingAnchor() + { + var rect = App.WaitForElement(BoxViewId).GetRect(); + App.Tap(ClickMeId); + var rect2 = App.WaitForElement(BoxViewId).GetRect(); + + ClassicAssert.AreEqual(rect.X, rect2.X); + ClassicAssert.AreEqual(rect.Y, rect2.Y); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6963.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6963.cs new file mode 100644 index 000000000000..ff72edf141d0 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6963.cs @@ -0,0 +1,25 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6963 : _IssuesUITest + { + public Issue6963(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView multiple pre-selection throws ArgumentOutOfRangeException when SelectedItems is bound to an ObservableCollection initialized inside the constructor."; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void SelectedItemsNotInSourceDoesNotCrash() + { + // If this page didn't crash, then we're good + App.WaitForElement("FirstLabel"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6994.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6994.cs new file mode 100644 index 000000000000..e38876ee6d7b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6994.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue6994 : _IssuesUITest + { + public Issue6994(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Regression in Xamarin.Forms 4.2.0-pre1 (Java.Lang.NullPointerException when using FastRenderers)"; + + [Test] + [Category(UITestCategories.Button)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void NullPointerExceptionOnFastLabelTextColorChange() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("Click me"); + App.Tap("Click me"); + App.WaitForElement("Success"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7102.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7102.cs new file mode 100644 index 000000000000..336eb7a02dc1 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7102.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7102 : _IssuesUITest + { + public Issue7102(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView Header cause delay to adding items."; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void HeaderDoesNotBreakIndexes() + { + App.WaitForElement("entryInsert"); + App.Tap("entryInsert"); + App.ClearText("entryInsert"); + App.EnterText("entryInsert", "1"); + App.Tap("btnInsert"); + + // If the bug is still present, then there will be + // two "Item: 0" items instead of the newly inserted item + // Or the header will have disappeared + App.WaitForNoElement("Inserted"); + App.WaitForNoElement("This is the header"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7313.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7313.cs new file mode 100644 index 000000000000..a806c678a744 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7313.cs @@ -0,0 +1,28 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7313 : _IssuesUITest + { + public Issue7313(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ListView RefreshControl Not Hiding"; + + [Test] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void RefreshControlTurnsOffSuccessfully() + { + App.WaitForNoElement("If you see the refresh circle this test has failed"); + + App.WaitForNoElement("RefreshControl"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7338.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7338.cs new file mode 100644 index 000000000000..866bd43c4a76 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7338.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7338 : _IssuesUITest + { + const string Success = "success"; + + public Issue7338(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView crash if source is empty in XF 4.2.0.709249"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void Issue3273Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + // If the instructions are visible at all, then this has succeeded + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7371.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7371.cs new file mode 100644 index 000000000000..b0347778eaed --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7371.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7371 : _IssuesUITest + { + public Issue7371(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "iOS race condition(or not checking for null) of refreshing(offset animation) causes NullReferenceException"; + + [Test] + [Category(UITestCategories.RefreshView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public async Task RefreshingListViewCrashesWhenDisposedTest() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + await Task.Delay(500); + App.WaitForElement("Success"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7393.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7393.cs new file mode 100644 index 000000000000..e732449358e3 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7393.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7393 : _IssuesUITest + { + const string Success = "Success"; + + public Issue7393(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView problems and crashes with IsGrouped=\"true\""; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void AddingItemsToGroupedCollectionViewShouldNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(Success, timeout: TimeSpan.FromSeconds(30)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7534.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7534.cs new file mode 100644 index 000000000000..1201ab567716 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7534.cs @@ -0,0 +1,29 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue7534 : _IssuesUITest + { + public Issue7534(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Span with tail truncation and paragraph breaks with Java.Lang.IndexOutOfBoundsException"; + + // Crash after navigation + /* + [Test] + [Category(UITestCategories.Label)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void ExpectingPageNotToBreak() + { + App.Screenshot("Test passed, label is showing as it should!"); + //if it doesn't crash, we're good. + } + */ + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue773.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue773.cs new file mode 100644 index 000000000000..8b4c574dfd5f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue773.cs @@ -0,0 +1,41 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue773 : _IssuesUITest + { + public Issue773(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Horizontal ScrollView locks after rotation"; + + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + public void Issue773TestsRotationRelayoutIssue() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.SetOrientationLandscape(); + + var buttonLabels = new[] { + "Button1", + "Button2", + "Button3", + }; + + foreach (string buttonLabel in buttonLabels) + App.WaitForElement(buttonLabel); + + App.Screenshot("StackLayout in Modal respects rotation"); + + App.SetOrientationPortrait(); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8004.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8004.cs new file mode 100644 index 000000000000..bfb34577ae48 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8004.cs @@ -0,0 +1,42 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8004 : _IssuesUITest + { + const string AnimateBoxViewButton = "AnimateBoxViewButton"; + const string BoxToScale = "BoxToScale"; + + public Issue8004(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Add a ScaleXTo and ScaleYTo animation extension method"; + + [Test] + [Category(UITestCategories.Animation)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task AnimateScaleOfBoxView() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Windows]); + + App.WaitForElement("TestReady"); + App.Screenshot("Small blue box"); + + // Check the box and button elements. + App.WaitForElement(BoxToScale); + App.WaitForElement(AnimateBoxViewButton); + + // Tap the button. + App.Tap(AnimateBoxViewButton); + + // Wait for animation to finish. + await Task.Delay(500); + + App.Screenshot("Bigger blue box"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8167.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8167.cs new file mode 100644 index 000000000000..b85ec03775b7 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8167.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8167 : _IssuesUITest + { + const string Run = "Update Text"; + const string Success = "Success"; + + public Issue8167(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] XF 4.3 UWP Crash - Element not found"; + + [Test] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ThreadpoolBindingUpdateShouldNotCrash() + { + App.WaitForElement(Run); + App.Tap(Run); + App.WaitForNoElement(Success); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8262.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8262.cs new file mode 100644 index 000000000000..8402bdcd9ef5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8262.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8262 : _IssuesUITest + { + public Issue8262(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] ImageRenderer still being accessed after control destroyed"; + + [Test] + [Category(UITestCategories.Image)] + [Category(UITestCategories.LifeCycle)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void ScrollingQuicklyOnCollectionViewDoesntCrashOnDestroyedImage() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("ScrollMe"); + App.ScrollDown("ScrollMe", ScrollStrategy.Gesture, swipeSpeed: 20000); + App.ScrollUp("ScrollMe", ScrollStrategy.Gesture, swipeSpeed: 20000); + App.ScrollDown("ScrollMe", ScrollStrategy.Gesture, swipeSpeed: 20000); + App.ScrollUp("ScrollMe", ScrollStrategy.Gesture, swipeSpeed: 20000); + App.ScrollDown("ScrollMe", ScrollStrategy.Gesture, swipeSpeed: 20000); + App.WaitForElement("ScrollMe"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8263.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8263.cs new file mode 100644 index 000000000000..a29adecc4d3e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8263.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8263 : _IssuesUITest + { + public Issue8263(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Enhancement] Add On/Off VisualStates for Switch"; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void SwitchOnOffVisualStatesTest() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("Switch"); + App.Screenshot("Switch Default"); + App.Tap("Switch"); + App.Screenshot("Switch Off with Red ThumbColor"); + App.Tap("Switch"); + App.Screenshot("Switch On with Green ThumbColor"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue852.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue852.cs new file mode 100644 index 000000000000..43c7ab20b4a2 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue852.cs @@ -0,0 +1,41 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue852 : _IssuesUITest + { + const string UsernameId = "username852"; + const string PasswordId = "password852"; + + public Issue852(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Async loading of Content causes UI element to be unclickable"; + + [Test] + [Category(UITestCategories.Entry)] + [Category(UITestCategories.Compatibility)] + public void Issue852TestsEntriesClickable() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("WelcomeLabel"); + App.WaitForElement(UsernameId); + App.WaitForElement(PasswordId); + App.WaitForElement("Login"); + App.Screenshot("All elements present"); + + App.Tap(UsernameId); + App.WaitForElement("WelcomeLabel"); + App.EnterText(UsernameId, "Usertest"); + App.Screenshot("User entered"); + + App.Tap(PasswordId); + App.WaitForElement("WelcomeLabel"); + App.EnterText(PasswordId, "Userpass"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs new file mode 100644 index 000000000000..5141893cc19d --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8529.cs @@ -0,0 +1,35 @@ +/* +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8529 : _IssuesUITest + { + const string ButtonId = "ButtonId"; + + public Issue8529(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [Shell] iOS - BackButtonBehavior Command property binding throws InvalidCastException when using a custom command class that implements ICommand"; + + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void Issue8529ShellBackButtonBehaviorCommandPropertyCanUseICommand() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(ButtonId, "Timed out waiting for first page."); + App.Tap(ButtonId); + App.WaitForElement("LabelId", "Timed out waiting for the destination page."); + App.Back(); + App.WaitForElement(ButtonId, "Timed out waiting to navigate back to the first page."); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8715.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8715.cs new file mode 100644 index 000000000000..ce6a08997a30 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8715.cs @@ -0,0 +1,35 @@ +#if IOS +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8715 : _IssuesUITest + { + const string FlyoutIconAutomationId = "OK"; + + public Issue8715(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "NullReferenceException Microsoft.Maui.Controls.Platform.iOS.StructuredItemsViewRenderer [Bug]"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void ReappearingCollectionViewShouldNotThrowNRE() + { + App.Tap(FlyoutIconAutomationId); + App.Tap("CollectionView"); + App.Tap("Toggle"); + App.Tap("Toggle"); + App.Tap(FlyoutIconAutomationId); + App.Tap("About"); + App.Tap(FlyoutIconAutomationId); + App.Tap("CollectionView"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8766.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8766.cs new file mode 100644 index 000000000000..563b178b7a3b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8766.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8766 : _IssuesUITest + { + public Issue8766(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView.EmptyView does not inherit parent Visual"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void VisualPropagatesToEmptyView() + { + App.WaitForElement("TestReady"); + App.Screenshot("CollectionViewWithEmptyView"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8801.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8801.cs new file mode 100644 index 000000000000..086989ea4d7a --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8801.cs @@ -0,0 +1,28 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8801 : _IssuesUITest + { + public Issue8801(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Android] Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference"; + + // Crash after navigation + /* + [Test] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + public void NotAddingElementsNativelyDoesntCrashAndroid() + { + App.WaitForElement("Success"); + } + */ + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8814.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8814.cs new file mode 100644 index 000000000000..d9825d57930b --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8814.cs @@ -0,0 +1,30 @@ +/* +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8814 : _IssuesUITest + { + const string Success = "Success"; + + public Issue8814(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] UWP Shell cannot host CollectionView/CarouselView"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void CollectionViewInShellShouldBeVisible() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForNoElement(Success); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8870.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8870.cs new file mode 100644 index 000000000000..56121ff46481 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8870.cs @@ -0,0 +1,49 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8870 : _IssuesUITest + { + const string Success = "Success"; + const string CheckResult = "Check"; + + public Issue8870(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView with HTML Labels Freeze the Screen on Rotation"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public async Task RotatingCollectionViewWithHTMLShouldNotHangOrCrash() + { + int delay = 3000; + + App.WaitForElement(CheckResult); + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.SetOrientationLandscape(); + await Task.Delay(delay); + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.SetOrientationLandscape(); + await Task.Delay(delay); + + App.SetOrientationPortrait(); + await Task.Delay(delay); + + App.WaitForElement(CheckResult); + App.Tap(CheckResult); + + App.WaitForNoElement(Success); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8899.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8899.cs new file mode 100644 index 000000000000..b05af1c8af6f --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8899.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue8899 : _IssuesUITest + { + const string Go = "Go"; + const string Success = "Success"; + + public Issue8899(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Clearing CollectionView IsGrouped=\"True\" crashes application iOS "; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void ClearingGroupedCollectionViewShouldNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(Go); + App.Tap(Go); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9006.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9006.cs new file mode 100644 index 000000000000..50680fb31706 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9006.cs @@ -0,0 +1,31 @@ +/* +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9006 : _IssuesUITest + { + public Issue9006(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] Unable to open a new Page for the second time in Xamarin.Forms Shell Tabbar"; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void ClickingOnTabToPopToRootDoesntBreakNavigation() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("Click Me"); + App.WaitForElement("FinalLabel"); + App.Tap("Tab1AutomationId"); + App.Tap("Click Me"); + App.WaitForNoElement("Success"); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9087.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9087.cs new file mode 100644 index 000000000000..7232f802bac8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9087.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9087 : _IssuesUITest + { + const string Success = "Success"; + + public Issue9087(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[UWP] Scrollview with null content crashes on UWP"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void BindablePropertiesAvailableAtOnElementChanged() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]); + + App.WaitForNoElement(Success); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9196.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9196.cs new file mode 100644 index 000000000000..47e76c155bb5 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9196.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9196 : _IssuesUITest + { + const string Success = "Success"; + + public Issue9196(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] [iOS] CollectionView EmptyView causes the application to crash"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void EmptyViewShouldNotCrash() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9306.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9306.cs new file mode 100644 index 000000000000..4e108f9a11ac --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9306.cs @@ -0,0 +1,41 @@ +using NUnit.Framework; +using NUnit.Framework.Legacy; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9306 : _IssuesUITest + { + const string SwipeViewId = "SwipeViewId"; + const string SwipeItemId = "SwipeItemId"; + const string LeftCountLabelId = "LeftCountLabel"; + + public Issue9306(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Cannot un-reveal swipe view items on iOS / Inconsistent swipe view behaviour"; + + [Test] + [Category(UITestCategories.SwipeView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue9306SwipeViewCloseSwiping() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(SwipeViewId); + + App.SwipeLeftToRight(SwipeViewId); + App.SwipeRightToLeft(SwipeViewId); + App.SwipeLeftToRight(SwipeViewId); + + App.Tap(SwipeItemId); + + var result = App.FindElement(LeftCountLabelId).GetText(); + + ClassicAssert.AreEqual("1", result); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue935.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue935.cs new file mode 100644 index 000000000000..461d4045f902 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue935.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue935 : _IssuesUITest + { + public Issue935(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ViewCell.ItemTapped only fires once for ListView.SelectedItem"; + + [Test] + [Description("Verify that OnTapped is fired every time a ViewCell is tapped")] + [Category(UITestCategories.ListView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue935TestsMultipleOnTappedViewCell() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("TestLabel"); + App.Screenshot("Tapped Cell Once"); + App.Tap("TestLabel"); + App.Screenshot("Tapped Cell Twice"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9355.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9355.cs new file mode 100644 index 000000000000..e31c6a211f62 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9355.cs @@ -0,0 +1,28 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9355 : _IssuesUITest + { + const string TestOk = "Test Ok"; + + public Issue9355(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "ScrollViewRenderer renderer dispose crash"; + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.ScrollView)] + [Category(UITestCategories.Compatibility)] + public void Issue9355Test() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForNoElement(TestOk); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9419.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9419.cs new file mode 100644 index 000000000000..99fb0c42c1cc --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9419.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9419 : _IssuesUITest + { + const string OkResult = "Ok"; + + public Issue9419(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Crash when toolbar item removed then page changed"; + + [Test] + [Category(UITestCategories.ToolbarItem)] + [Category(UITestCategories.Compatibility)] + public void TestIssue9419() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(OkResult); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9580.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9580.cs new file mode 100644 index 000000000000..cdfc2ae6d4be --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9580.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9580 : _IssuesUITest + { + const string Success = "Success"; + const string Test9580 = "9580"; + + public Issue9580(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] CollectionView - iOS - Crash when adding first item to empty item group"; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + public void AllEmptyGroupsShouldNotCrashOnItemInsert() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(Test9580); + App.Tap(Test9580); + App.WaitForElement(Success); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue968.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue968.cs new file mode 100644 index 000000000000..6346091dac66 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue968.cs @@ -0,0 +1,33 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue968 : _IssuesUITest + { + public Issue968(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "StackLayout does not relayout on device rotation"; + + [Test] + [Description("Verify the layout lays out on rotations")] + [Category(UITestCategories.Layout)] + [Category(UITestCategories.Compatibility)] + [FailsOnAndroid] + [FailsOnIOS] + public void Issue968TestsRotationRelayoutIssue() + { + this.IgnoreIfPlatforms([TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("TestReady"); + App.SetOrientationLandscape(); + App.Screenshot("Rotated to Landscape"); + App.WaitForNoElement("You should see me after rotating"); + App.Screenshot("StackLayout in Modal respects rotation"); + App.SetOrientationPortrait(); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs new file mode 100644 index 000000000000..bec35e18e489 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9794.cs @@ -0,0 +1,36 @@ +/* +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9794 : _IssuesUITest + { + public Issue9794(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[iOS] Tabbar Disappears with linker"; + + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.Shell)] + [Category(UITestCategories.Compatibility)] + public void EnsureTabBarStaysVisibleAfterPoppingPage() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.Tap("GoForward"); + App.Back(); + App.Tap("tab2"); + App.Tap("tab1"); + App.Tap("tab2"); + App.Tap("tab1"); + App.Tap("tab2"); + App.Tap("tab1"); + } + } +} +*/ \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9929.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9929.cs new file mode 100644 index 000000000000..a674b2be1fdd --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9929.cs @@ -0,0 +1,35 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9929 : _IssuesUITest + { + public Issue9929(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "[Bug] NSInternalInconsistencyException when trying to run XamarinTV on iOS"; + + public override bool ResetMainPage => false; + + [Test] + [Category(UITestCategories.CollectionView)] + [Category(UITestCategories.Compatibility)] + [FailsOnIOS] + public void Issue3884Test() + { + this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement("entryUpdate_Spacing"); + App.Tap("entryUpdate_Spacing"); + App.ClearText("entryUpdate_Spacing"); + App.EnterText("entryUpdate_Spacing", "0,500"); + App.Tap("btnUpdate_Spacing"); + + // If it hasn't crashed, we should still be able to find this + App.WaitForElement("entryUpdate_Spacing"); + } + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9951.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9951.cs new file mode 100644 index 000000000000..4fb8667e4287 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue9951.cs @@ -0,0 +1,38 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue9951 : _IssuesUITest + { + const string SwitchId = "switch"; + + public Issue9951(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Android 10 Setting ThumbColor on Switch causes a square block"; + + [Test] + [Category(UITestCategories.Switch)] + [Category(UITestCategories.Compatibility)] + public async Task SwitchColorTest() + { + this.IgnoreIfPlatforms([TestDevice.iOS, TestDevice.Mac, TestDevice.Windows]); + + App.WaitForElement(SwitchId); + + App.Screenshot("Initial switch state"); + + App.Tap(SwitchId); + + //Delay so that the switch toggling is finished + await Task.Delay(200); + + App.Screenshot("Toggled switch state"); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITestCategories.cs b/src/Controls/tests/TestCases.Shared.Tests/UITestCategories.cs index d08e4194c378..19f321c932cb 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UITestCategories.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UITestCategories.cs @@ -64,5 +64,6 @@ internal static class UITestCategories public const string Shape = "Shape"; public const string Accessibility = "Accessibility"; public const string Brush = "Brush"; + public const string Compatibility = "MovedFromCompatibility"; } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs new file mode 100644 index 000000000000..14785ef69ba6 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs @@ -0,0 +1,102 @@ +using NUnit.Framework; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class FailsOnAllPlatforms : IgnoreAttribute + { + public FailsOnAllPlatforms() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAllPlatforms(string reason) : base(reason) + { + } + } + +#if ANDROID + public class FailsOnAndroid : IgnoreAttribute + { + public FailsOnAndroid() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAndroid(string reason) : base(reason) + { + } + } +#else + public class FailsOnAndroid : CategoryAttribute + { + public FailsOnAndroid() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAndroid(string name) : base(name) + { + } + } +#endif + +#if IOS + public class FailsOnIOS : IgnoreAttribute + { + public FailsOnIOS() : base(nameof(FailsOnIOS)) + { + } + public FailsOnIOS(string reason) : base(reason) + { + } + } +#else + public class FailsOnIOS : CategoryAttribute + { + public FailsOnIOS() : base(nameof(FailsOnIOS)) + { + } + public FailsOnIOS(string name) : base(name) + { + } + } +#endif + +#if MACCATALYST + public class FailsOnMac : IgnoreAttribute + { + public FailsOnMac() : base(nameof(FailsOnMac)) + { + } + public FailsOnMac(string reason) : base(reason) + { + } + } +#else + public class FailsOnMac : CategoryAttribute + { + public FailsOnMac() : base(nameof(FailsOnMac)) + { + } + public FailsOnMac(string name) : base(name) + { + } + } +#endif + +#if WINDOWS + public class FailsOnWindows : IgnoreAttribute + { + public FailsOnWindows() : base(nameof(FailsOnWindows)) + { + } + public FailsOnWindows(string reason) : base(reason) + { + } + } +#else + public class FailsOnWindows : CategoryAttribute + { + public FailsOnWindows() : base(nameof(FailsOnWindows)) + { + } + public FailsOnWindows(string name) : base(name) + { + } + } +#endif +} \ No newline at end of file From 5f07e5abfa7a90fe57902d27b79ebdf02b201af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Thu, 23 May 2024 12:46:47 +0200 Subject: [PATCH 02/43] Added tests pages --- .../tests/TestCases/Issues/Bugzilla23942.xaml | 21 + .../TestCases/Issues/Bugzilla23942.xaml.cs | 97 +++++ .../tests/TestCases/Issues/Bugzilla25943.cs | 81 ++++ .../tests/TestCases/Issues/Bugzilla29128.cs | 24 ++ .../tests/TestCases/Issues/Bugzilla29363.cs | 39 ++ .../tests/TestCases/Issues/Bugzilla29453.cs | 59 +++ .../tests/TestCases/Issues/Bugzilla30166.cs | 34 ++ .../tests/TestCases/Issues/Bugzilla30935.cs | 34 ++ .../tests/TestCases/Issues/Bugzilla31255.cs | 80 ++++ .../tests/TestCases/Issues/Bugzilla31366.cs | 70 ++++ .../tests/TestCases/Issues/Bugzilla31395.cs | 39 ++ .../tests/TestCases/Issues/Bugzilla31688.cs | 116 ++++++ .../tests/TestCases/Issues/Bugzilla32206.cs | 114 +++++ .../tests/TestCases/Issues/Bugzilla32615.cs | 54 +++ .../tests/TestCases/Issues/Bugzilla32830.cs | 129 ++++++ .../tests/TestCases/Issues/Bugzilla32898.cs | 78 ++++ .../tests/TestCases/Issues/Bugzilla34007.cs | 66 +++ .../tests/TestCases/Issues/Bugzilla34061.cs | 64 +++ .../tests/TestCases/Issues/Bugzilla35472.cs | 79 ++++ .../tests/TestCases/Issues/Bugzilla35477.cs | 35 ++ .../tests/TestCases/Issues/Bugzilla35733.cs | 48 +++ .../tests/TestCases/Issues/Bugzilla35736.cs | 39 ++ .../tests/TestCases/Issues/Bugzilla36009.cs | 48 +++ .../tests/TestCases/Issues/Bugzilla36559.cs | 40 ++ .../tests/TestCases/Issues/Bugzilla36703.cs | 54 +++ .../tests/TestCases/Issues/Bugzilla36780.cs | 62 +++ .../tests/TestCases/Issues/Bugzilla36788.cs | 119 ++++++ .../tests/TestCases/Issues/Bugzilla36802.cs | 78 ++++ .../tests/TestCases/Issues/Bugzilla37625.cs | 26 ++ .../tests/TestCases/Issues/Bugzilla38723.cs | 51 +++ .../tests/TestCases/Issues/Bugzilla38989.cs | 41 ++ .../tests/TestCases/Issues/Bugzilla39489.cs | 79 ++++ .../tests/TestCases/Issues/Bugzilla39636.xaml | 41 ++ .../TestCases/Issues/Bugzilla39636.xaml.cs | 33 ++ .../tests/TestCases/Issues/Bugzilla39668.cs | 42 ++ .../tests/TestCases/Issues/Bugzilla39702.cs | 49 +++ .../tests/TestCases/Issues/Bugzilla39821.cs | 116 ++++++ .../tests/TestCases/Issues/Bugzilla40005.cs | 130 ++++++ .../tests/TestCases/Issues/Bugzilla41205.cs | 51 +++ .../tests/TestCases/Issues/Bugzilla41600.cs | 54 +++ .../tests/TestCases/Issues/Bugzilla41619.cs | 60 +++ .../tests/TestCases/Issues/Bugzilla41842.cs | 22 + .../tests/TestCases/Issues/Bugzilla42277.cs | 110 +++++ .../tests/TestCases/Issues/Bugzilla42956.cs | 129 ++++++ .../tests/TestCases/Issues/Bugzilla43519.cs | 71 ++++ .../tests/TestCases/Issues/Bugzilla44096.cs | 140 +++++++ .../tests/TestCases/Issues/Bugzilla44176.cs | 113 +++++ .../tests/TestCases/Issues/Bugzilla44476.cs | 52 +++ .../tests/TestCases/Issues/Bugzilla45702.cs | 39 ++ .../tests/TestCases/Issues/Bugzilla45722.cs | 167 ++++++++ .../tests/TestCases/Issues/Bugzilla46458.cs | 90 ++++ .../tests/TestCases/Issues/Bugzilla51238.cs | 53 +++ .../tests/TestCases/Issues/Bugzilla51503.cs | 58 +++ .../tests/TestCases/Issues/Bugzilla51505.cs | 37 ++ .../tests/TestCases/Issues/Bugzilla52533.cs | 46 +++ .../tests/TestCases/Issues/Bugzilla53179.cs | 67 +++ .../tests/TestCases/Issues/Bugzilla53445.cs | 78 ++++ .../tests/TestCases/Issues/Bugzilla53834.cs | 81 ++++ .../tests/TestCases/Issues/Bugzilla55365.cs | 80 ++++ .../tests/TestCases/Issues/Bugzilla55745.cs | 154 +++++++ .../tests/TestCases/Issues/Bugzilla55912.cs | 75 ++++ .../tests/TestCases/Issues/Bugzilla56298.cs | 106 +++++ .../tests/TestCases/Issues/Bugzilla56771.cs | 135 ++++++ .../tests/TestCases/Issues/Bugzilla56896.cs | 210 ++++++++++ .../tests/TestCases/Issues/Bugzilla57114.cs | 92 +++++ .../tests/TestCases/Issues/Bugzilla57674.cs | 81 ++++ .../tests/TestCases/Issues/Bugzilla57758.cs | 37 ++ .../tests/TestCases/Issues/Bugzilla57910.cs | 237 +++++++++++ .../tests/TestCases/Issues/Bugzilla58645.cs | 130 ++++++ .../tests/TestCases/Issues/Bugzilla59097.cs | 36 ++ .../tests/TestCases/Issues/Bugzilla59172.cs | 77 ++++ .../tests/TestCases/Issues/Bugzilla59896.cs | 86 ++++ .../tests/TestCases/Issues/Bugzilla59925.cs | 51 +++ .../tests/TestCases/Issues/GitHub1567.cs | 93 +++++ .../tests/TestCases/Issues/GitHub1648.cs | 49 +++ .../tests/TestCases/Issues/Github1625.cs | 49 +++ .../tests/TestCases/Issues/Github6384.cs | 65 +++ .../tests/TestCases/Issues/Issue10182.cs | 60 +++ .../tests/TestCases/Issues/Issue10222.cs | 76 ++++ .../tests/TestCases/Issues/Issue10454.cs | 90 ++++ .../tests/TestCases/Issues/Issue10563.cs | 138 +++++++ .../tests/TestCases/Issues/Issue10744.cs | 61 +++ .../tests/TestCases/Issues/Issue11132.cs | 51 +++ .../tests/TestCases/Issues/Issue11209.xaml | 58 +++ .../tests/TestCases/Issues/Issue11209.xaml.cs | 65 +++ .../tests/TestCases/Issues/Issue11311.cs | 121 ++++++ .../tests/TestCases/Issues/Issue11333.xaml | 76 ++++ .../tests/TestCases/Issues/Issue11333.xaml.cs | 43 ++ .../tests/TestCases/Issues/Issue1146.cs | 36 ++ .../tests/TestCases/Issues/Issue11769.cs | 85 ++++ .../tests/TestCases/Issues/Issue11853.xaml | 34 ++ .../tests/TestCases/Issues/Issue11853.xaml.cs | 92 +++++ .../tests/TestCases/Issues/Issue11962.cs | 67 +++ .../tests/TestCases/Issues/Issue11969.xaml | 126 ++++++ .../tests/TestCases/Issues/Issue11969.xaml.cs | 52 +++ .../tests/TestCases/Issues/Issue12060.cs | 83 ++++ .../tests/TestCases/Issues/Issue12079.cs | 82 ++++ .../tests/TestCases/Issues/Issue12134.cs | 104 +++++ .../tests/TestCases/Issues/Issue12153.cs | 36 ++ .../tests/TestCases/Issues/Issue1219.cs | 25 ++ .../tests/TestCases/Issues/Issue12193.cs | 57 +++ .../tests/TestCases/Issues/Issue12246.cs | 71 ++++ .../tests/TestCases/Issues/Issue1236.cs | 27 ++ .../tests/TestCases/Issues/Issue12374.xaml | 87 ++++ .../tests/TestCases/Issues/Issue12374.xaml.cs | 117 ++++++ .../tests/TestCases/Issues/Issue12484.xaml | 17 + .../tests/TestCases/Issues/Issue12484.xaml.cs | 50 +++ .../tests/TestCases/Issues/Issue12642.cs | 66 +++ .../tests/TestCases/Issues/Issue1267.cs | 76 ++++ .../tests/TestCases/Issues/Issue12714.cs | 38 ++ .../tests/TestCases/Issues/Issue12777.cs | 89 ++++ .../tests/TestCases/Issues/Issue12848.xaml | 42 ++ .../tests/TestCases/Issues/Issue12848.xaml.cs | 31 ++ .../tests/TestCases/Issues/Issue13126_2.cs | 57 +++ .../tests/TestCases/Issues/Issue13203.cs | 44 ++ .../tests/TestCases/Issues/Issue13390.cs | 23 ++ .../tests/TestCases/Issues/Issue13436.xaml | 52 +++ .../tests/TestCases/Issues/Issue13436.xaml.cs | 76 ++++ .../tests/TestCases/Issues/Issue13476.cs | 52 +++ .../tests/TestCases/Issues/Issue1355.cs | 47 +++ .../tests/TestCases/Issues/Issue13551.cs | 119 ++++++ .../tests/TestCases/Issues/Issue13616.xaml | 75 ++++ .../tests/TestCases/Issues/Issue13616.xaml.cs | 96 +++++ .../tests/TestCases/Issues/Issue1426.cs | 59 +++ .../tests/TestCases/Issues/Issue1436.cs | 97 +++++ .../tests/TestCases/Issues/Issue1469.cs | 49 +++ .../tests/TestCases/Issues/Issue1538.cs | 31 ++ .../tests/TestCases/Issues/Issue1583.cs | 22 + .../tests/TestCases/Issues/Issue1583_1.cs | 59 +++ .../tests/TestCases/Issues/Issue1590.cs | 126 ++++++ .../tests/TestCases/Issues/Issue1601.cs | 41 ++ .../tests/TestCases/Issues/Issue1667.cs | 92 +++++ .../tests/TestCases/Issues/Issue1683.cs | 183 ++++++++ .../tests/TestCases/Issues/Issue1685.cs | 85 ++++ .../tests/TestCases/Issues/Issue1700.cs | 38 ++ .../tests/TestCases/Issues/Issue1733.cs | 213 ++++++++++ .../tests/TestCases/Issues/Issue1747.xaml | 14 + .../tests/TestCases/Issues/Issue1747.xaml.cs | 68 +++ .../tests/TestCases/Issues/Issue1769.cs | 81 ++++ .../tests/TestCases/Issues/Issue1799.cs | 31 ++ .../tests/TestCases/Issues/Issue181.cs | 30 ++ .../tests/TestCases/Issues/Issue1851.cs | 92 +++++ .../tests/TestCases/Issues/Issue1900.cs | 39 ++ .../tests/TestCases/Issues/Issue1905.cs | 83 ++++ .../tests/TestCases/Issues/Issue1908.cs | 48 +++ .../tests/TestCases/Issues/Issue1909.cs | 56 +++ .../tests/TestCases/Issues/Issue1931.cs | 165 ++++++++ .../tests/TestCases/Issues/Issue1937.cs | 114 +++++ .../tests/TestCases/Issues/Issue1942.cs | 54 +++ .../tests/TestCases/Issues/Issue1975.cs | 153 +++++++ .../tests/TestCases/Issues/Issue2004.cs | 298 +++++++++++++ .../tests/TestCases/Issues/Issue2035.cs | 21 + .../tests/TestCases/Issues/Issue2222.cs | 55 +++ .../tests/TestCases/Issues/Issue2241.cs | 100 +++++ .../tests/TestCases/Issues/Issue2259.cs | 174 ++++++++ .../tests/TestCases/Issues/Issue2339.cs | 80 ++++ .../tests/TestCases/Issues/Issue2354.cs | 140 +++++++ .../tests/TestCases/Issues/Issue2399.cs | 135 ++++++ .../tests/TestCases/Issues/Issue2482.cs | 95 +++++ .../tests/TestCases/Issues/Issue2617.cs | 127 ++++++ .../tests/TestCases/Issues/Issue2653.cs | 147 +++++++ .../tests/TestCases/Issues/Issue2674.cs | 29 ++ .../TestCases/Issues/Issue2680ScrollView.cs | 67 +++ .../tests/TestCases/Issues/Issue2681.cs | 86 ++++ .../tests/TestCases/Issues/Issue2728.cs | 44 ++ .../tests/TestCases/Issues/Issue2775.cs | 112 +++++ .../tests/TestCases/Issues/Issue2777.xaml | 23 ++ .../tests/TestCases/Issues/Issue2777.xaml.cs | 145 +++++++ .../tests/TestCases/Issues/Issue2829.cs | 164 ++++++++ .../tests/TestCases/Issues/Issue2837.cs | 42 ++ .../tests/TestCases/Issues/Issue2842.cs | 75 ++++ .../tests/TestCases/Issues/Issue2858.xaml | 35 ++ .../tests/TestCases/Issues/Issue2858.xaml.cs | 85 ++++ .../tests/TestCases/Issues/Issue2929.cs | 117 ++++++ .../tests/TestCases/Issues/Issue2963.cs | 62 +++ .../tests/TestCases/Issues/Issue2983.cs | 37 ++ .../tests/TestCases/Issues/Issue3000.cs | 129 ++++++ .../tests/TestCases/Issues/Issue3001.cs | 90 ++++ .../tests/TestCases/Issues/Issue3049.cs | 87 ++++ .../tests/TestCases/Issues/Issue3087.cs | 64 +++ .../tests/TestCases/Issues/Issue3089.cs | 132 ++++++ .../tests/TestCases/Issues/Issue3262.cs | 390 ++++++++++++++++++ .../tests/TestCases/Issues/Issue3273.cs | 84 ++++ .../tests/TestCases/Issues/Issue3275.cs | 214 ++++++++++ .../tests/TestCases/Issues/Issue3333.cs | 100 +++++ .../tests/TestCases/Issues/Issue3342.cs | 63 +++ .../tests/TestCases/Issues/Issue3385.cs | 27 ++ .../tests/TestCases/Issues/Issue3390.cs | 64 +++ .../tests/TestCases/Issues/Issue3413.cs | 81 ++++ .../tests/TestCases/Issues/Issue342.cs | 66 +++ .../tests/TestCases/Issues/Issue3507.cs | 45 ++ .../tests/TestCases/Issues/Issue3548.cs | 71 ++++ .../tests/TestCases/Issues/Issue3667.cs | 97 +++++ .../tests/TestCases/Issues/Issue3884.cs | 51 +++ .../tests/TestCases/Issues/Issue417.cs | 78 ++++ .../tests/TestCases/Issues/Issue4600.cs | 19 + .../tests/TestCases/Issues/Issue465.cs | 47 +++ .../tests/TestCases/Issues/Issue4782.cs | 53 +++ .../tests/TestCases/Issues/Issue4879.cs | 89 ++++ .../tests/TestCases/Issues/Issue488.cs | 52 +++ .../tests/TestCases/Issues/Issue5239.cs | 45 ++ .../tests/TestCases/Issues/Issue5367.cs | 63 +++ .../tests/TestCases/Issues/Issue5376.cs | 96 +++++ .../tests/TestCases/Issues/Issue5461.cs | 57 +++ .../tests/TestCases/Issues/Issue5535.cs | 22 + .../tests/TestCases/Issues/Issue5765.cs | 80 ++++ .../tests/TestCases/Issues/Issue5830.cs | 58 +++ .../tests/TestCases/Issues/Issue5951.cs | 95 +++++ .../tests/TestCases/Issues/Issue6260.cs | 85 ++++ .../tests/TestCases/Issues/Issue6262.cs | 96 +++++ .../tests/TestCases/Issues/Issue6368.cs | 48 +++ .../tests/TestCases/Issues/Issue6458.cs | 45 ++ .../tests/TestCases/Issues/Issue6472.cs | 180 ++++++++ .../tests/TestCases/Issues/Issue6705.cs | 74 ++++ .../tests/TestCases/Issues/Issue6932.xaml | 46 +++ .../tests/TestCases/Issues/Issue6932.xaml.cs | 120 ++++++ .../tests/TestCases/Issues/Issue6945.cs | 81 ++++ .../tests/TestCases/Issues/Issue6963.cs | 39 ++ .../tests/TestCases/Issues/Issue6994.cs | 150 +++++++ .../tests/TestCases/Issues/Issue7102.cs | 20 + .../tests/TestCases/Issues/Issue7313.cs | 70 ++++ .../tests/TestCases/Issues/Issue7338.cs | 52 +++ .../tests/TestCases/Issues/Issue7371.cs | 29 ++ .../tests/TestCases/Issues/Issue7393.cs | 110 +++++ .../tests/TestCases/Issues/Issue7534.cs | 59 +++ .../tests/TestCases/Issues/Issue773.cs | 131 ++++++ .../tests/TestCases/Issues/Issue8004.cs | 97 +++++ .../tests/TestCases/Issues/Issue8167.cs | 124 ++++++ .../tests/TestCases/Issues/Issue8262.cs | 81 ++++ .../tests/TestCases/Issues/Issue8263.xaml | 27 ++ .../tests/TestCases/Issues/Issue8263.xaml.cs | 42 ++ .../tests/TestCases/Issues/Issue852.cs | 162 ++++++++ .../tests/TestCases/Issues/Issue8529.cs | 41 ++ .../tests/TestCases/Issues/Issue8715.xaml | 22 + .../tests/TestCases/Issues/Issue8715.xaml.cs | 96 +++++ .../tests/TestCases/Issues/Issue8766.cs | 55 +++ .../tests/TestCases/Issues/Issue8801.cs | 295 +++++++++++++ .../tests/TestCases/Issues/Issue8814.cs | 66 +++ .../tests/TestCases/Issues/Issue8870.cs | 99 +++++ .../tests/TestCases/Issues/Issue8899.cs | 115 ++++++ .../tests/TestCases/Issues/Issue9006.cs | 83 ++++ .../tests/TestCases/Issues/Issue9087.cs | 68 +++ .../tests/TestCases/Issues/Issue9196.xaml | 56 +++ .../tests/TestCases/Issues/Issue9196.xaml.cs | 55 +++ .../tests/TestCases/Issues/Issue9306.cs | 114 +++++ .../tests/TestCases/Issues/Issue935.cs | 81 ++++ .../tests/TestCases/Issues/Issue9355.cs | 56 +++ .../tests/TestCases/Issues/Issue9419.cs | 128 ++++++ .../tests/TestCases/Issues/Issue9580.cs | 90 ++++ .../tests/TestCases/Issues/Issue968.cs | 63 +++ .../tests/TestCases/Issues/Issue9794.cs | 60 +++ .../tests/TestCases/Issues/Issue9929.cs | 47 +++ .../tests/TestCases/Issues/Issue9951.cs | 55 +++ 253 files changed, 19880 insertions(+) create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla25943.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla29128.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla29363.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla29453.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla30166.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla30935.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla31255.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla31366.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla31395.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla31688.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla32206.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla32615.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla32830.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla32898.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla34007.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla34061.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla35472.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla35477.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla35733.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla35736.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36009.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36559.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36703.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36780.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36788.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla36802.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla37625.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla38723.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla38989.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39489.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39668.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39702.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla39821.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla40005.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla41205.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla41600.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla41619.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla41842.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla42277.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla42956.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla43519.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla44096.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla44176.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla44476.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla45702.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla45722.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla46458.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla51238.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla51503.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla51505.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla52533.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla53179.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla53445.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla53834.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla55365.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla55745.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla55912.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla56298.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla56771.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla56896.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla57114.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla57674.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla57758.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla57910.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla58645.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla59097.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla59172.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla59896.cs create mode 100644 src/Controls/tests/TestCases/Issues/Bugzilla59925.cs create mode 100644 src/Controls/tests/TestCases/Issues/GitHub1567.cs create mode 100644 src/Controls/tests/TestCases/Issues/GitHub1648.cs create mode 100644 src/Controls/tests/TestCases/Issues/Github1625.cs create mode 100644 src/Controls/tests/TestCases/Issues/Github6384.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue10182.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue10222.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue10454.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue10563.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue10744.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11132.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11209.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue11209.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11311.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11333.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue11333.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1146.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11769.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11853.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue11853.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11962.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue11969.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue11969.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12060.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12079.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12134.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12153.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1219.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12193.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12246.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1236.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12374.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue12374.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12484.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue12484.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12642.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1267.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12714.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12777.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue12848.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue12848.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13126_2.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13203.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13390.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13436.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue13436.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13476.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1355.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13551.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue13616.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue13616.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1426.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1436.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1469.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1538.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1583.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1583_1.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1590.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1601.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1667.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1683.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1685.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1700.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1733.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1747.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue1747.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1769.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1799.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue181.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1851.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1900.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1905.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1908.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1909.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1931.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1937.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1942.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue1975.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2004.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2035.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2222.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2241.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2259.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2339.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2354.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2399.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2482.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2617.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2653.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2674.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2680ScrollView.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2681.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2728.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2775.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2777.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue2777.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2829.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2837.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2842.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2858.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue2858.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2929.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2963.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue2983.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3000.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3001.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3049.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3087.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3089.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3262.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3273.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3275.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3333.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3342.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3385.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3390.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3413.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue342.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3507.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3548.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3667.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue3884.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue417.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue4600.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue465.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue4782.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue4879.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue488.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5239.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5367.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5376.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5461.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5535.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5765.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5830.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue5951.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6260.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6262.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6368.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6458.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6472.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6705.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6932.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue6932.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6945.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6963.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue6994.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7102.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7313.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7338.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7371.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7393.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue7534.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue773.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8004.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8167.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8262.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8263.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue8263.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue852.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8529.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8715.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue8715.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8766.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8801.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8814.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8870.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue8899.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9006.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9087.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9196.xaml create mode 100644 src/Controls/tests/TestCases/Issues/Issue9196.xaml.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9306.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue935.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9355.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9419.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9580.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue968.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9794.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9929.cs create mode 100644 src/Controls/tests/TestCases/Issues/Issue9951.cs diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml b/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml new file mode 100644 index 000000000000..343192c1ebb3 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml.cs b/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml.cs new file mode 100644 index 000000000000..f90ced9cbbf5 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla23942.xaml.cs @@ -0,0 +1,97 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 23942, "Cannot bind properties in BindableObjects added to static resources in XAML", PlatformAffected.All)] + public partial class Bugzilla23942 : TestContentPage + { + [Preserve(AllMembers = true)] + public class TestViewModel : ViewModelBase + { + string _doesItWork; + public string DoesItWork + { + get + { + return _doesItWork; + } + set + { + _doesItWork = value; + OnPropertyChanged(); + } + } + } + + public Bugzilla23942() + { + InitializeComponent(); + } + + private void InitializeView() + { + TestViewModel vm = new TestViewModel() { DoesItWork = "initial binding works" }; + BindingContext = vm; + vm.DoesItWork = "success"; + } + + protected override void Init() + { + InitializeView(); + } + + protected override void OnAppearing() + { + base.OnAppearing(); + var lbl = this.FindByName("label"); + lbl.Text = lbl.Options.Text; + } + } + + [Preserve(AllMembers = true)] + public class Bugzilla23942Options : BindableObject + { + public static readonly BindableProperty TextProperty = + BindableProperty.Create(propertyName: nameof(Text), + returnType: typeof(string), + declaringType: typeof(Bugzilla23942Options), + defaultValue: default(string)); + + public string Text + { + get + { + return (string)GetValue(TextProperty); + } + set + { + SetValue(TextProperty, value); + } + } + } + + [Preserve(AllMembers = true)] + public class Bugzilla23942Label : Label + { + public static readonly BindableProperty OptionsProperty = + BindableProperty.Create(propertyName: nameof(Options), + returnType: typeof(Bugzilla23942Options), + declaringType: typeof(Bugzilla23942Label), + defaultValue: default(Bugzilla23942Options)); + + public Bugzilla23942Options Options + { + get + { + return (Bugzilla23942Options)GetValue(OptionsProperty); + } + set + { + SetValue(OptionsProperty, value); + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla25943.cs b/src/Controls/tests/TestCases/Issues/Bugzilla25943.cs new file mode 100644 index 000000000000..39733c888b4a --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla25943.cs @@ -0,0 +1,81 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 25943, + "[Android] TapGestureRecognizer does not work with a nested StackLayout", PlatformAffected.Android)] + public class Bugzilla25943 : TestContentPage + { + Label _result; + int _taps; + const string InnerLayout = "innerlayout"; + const string OuterLayout = "outerlayout"; + const string Success = "Success"; + + protected override void Init() + { + StackLayout layout = GetNestedStackLayout(); + + var tapGestureRecognizer = new TapGestureRecognizer(); + tapGestureRecognizer.Tapped += (sender, e) => + { + _taps = _taps + 1; + if (_taps == 2) + { + _result.Text = Success; + } + }; + layout.GestureRecognizers.Add(tapGestureRecognizer); + + Content = layout; + } + + public StackLayout GetNestedStackLayout() + { + _result = new Label(); + + var innerLayout = new StackLayout + { + AutomationId = InnerLayout, + HeightRequest = 100, + Orientation = StackOrientation.Horizontal, + HorizontalOptions = LayoutOptions.Fill, + BackgroundColor = Colors.AntiqueWhite, + Children = + { + new Label + { + Text = "inner label", + FontSize = 20, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.CenterAndExpand + } + } + }; + + var outerLayout = new StackLayout + { + AutomationId = OuterLayout, + Orientation = StackOrientation.Vertical, + BackgroundColor = Colors.Brown, + Children = + { + _result, + innerLayout, + new Label + { + Text = "outer label", + FontSize = 20, + HorizontalOptions = LayoutOptions.Center, + } + } + }; + + return outerLayout; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla29128.cs b/src/Controls/tests/TestCases/Issues/Bugzilla29128.cs new file mode 100644 index 000000000000..468c679ca3e7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla29128.cs @@ -0,0 +1,24 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 29128, "Slider background lays out wrong Android")] + public class Bugzilla29128 : TestContentPage + { + protected override void Init() + { + Content = new Slider + { + AutomationId = "SliderId", + BackgroundColor = Colors.Blue, + Maximum = 255, + Minimum = 0, + }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla29363.cs b/src/Controls/tests/TestCases/Issues/Bugzilla29363.cs new file mode 100644 index 000000000000..c7d47da82386 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla29363.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 29363, "PushModal followed immediate by PopModal crashes")] + public class Bugzilla29363 : TestContentPage + { + protected override void Init() + { + var layout = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; + + Button modal = new Button + { + Text = "Modal Push Pop Test", + FontAttributes = FontAttributes.Bold, + FontSize = 25, + HorizontalOptions = LayoutOptions.Center + }; + modal.Clicked += async (object sender, EventArgs e) => + { + var page = new ContentPage() { BackgroundColor = Colors.Red }; + + await Navigation.PushModalAsync(page); + + await Navigation.PopModalAsync(true); + }; + + layout.Children.Add(modal); + Content = layout; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla29453.cs b/src/Controls/tests/TestCases/Issues/Bugzilla29453.cs new file mode 100644 index 000000000000..7b25ca06e05d --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla29453.cs @@ -0,0 +1,59 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 29453, "Navigation.PopAsync(false) in Entry.Completed handler => System.ArgumentException", PlatformAffected.Android)] + public class Bugzilla29453 : TestContentPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + var page1Layout = new StackLayout + { + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 1" + } + } + }; + + var page2Layout = new StackLayout + { + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 2" + } + } + }; + + var entry = new Entry { AutomationId = "entryText" }; + + entry.Completed += async (sender, args) => + { + await Navigation.PopAsync(false); + }; + + page2Layout.Children.Add(entry); + + var page2 = new ContentPage + { + Content = page2Layout + }; + + var button = new Button + { + Text = "Go to page 2", + AutomationId = "btnGotoPage2", + Command = new Command(async () => await Navigation.PushAsync(page2)) + }; + + page1Layout.Children.Add(button); + Content = page1Layout; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla30166.cs b/src/Controls/tests/TestCases/Issues/Bugzilla30166.cs new file mode 100644 index 000000000000..b958d46af8e1 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla30166.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 30166, "NavigationBar.BarBackgroundColor resets on Lollipop after popping modal page", PlatformAffected.Android)] + public class Bugzilla30166 : TestNavigationPage + { + protected override void Init() + { + BarBackgroundColor = Colors.Red; + + Navigation.PushAsync(new ContentPage + { + Content = new Button + { + Text = "Push Modal", + Command = new Command(async () => await Navigation.PushModalAsync(new ContentPage + { + Content = new Button + { + Text = "Back", + Command = new Command(async () => await Navigation.PopModalAsync()), + }, + })), + }, + }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla30935.cs b/src/Controls/tests/TestCases/Issues/Bugzilla30935.cs new file mode 100644 index 000000000000..7a377c2ad3c0 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla30935.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 30935, "NullReferenceException in ViewRenderer (Microsoft.Maui.Controls.Platform.Android)")] + public class Bugzilla30935 : TestContentPage + { + Entry _entry; + protected override void Init() + { + _entry = new Entry { AutomationId = "entry" }; + // Initialize ui here instead of ctor + Content = new StackLayout + { + Children = { new Label { + AutomationId = "IssuePageLabel", + Text = "See if I'm here" + },_entry + } + }; + } + + protected override void OnAppearing() + { + _entry.Focus(); + Content = null; + base.OnAppearing(); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla31255.cs b/src/Controls/tests/TestCases/Issues/Bugzilla31255.cs new file mode 100644 index 000000000000..69e6b89ab6ad --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla31255.cs @@ -0,0 +1,80 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 31255, "Flyout's page Icon cause memory leak after FlyoutPage is popped out by holding on page")] + public class Bugzilla31255 : TestContentPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + var stack = new StackLayout() { VerticalOptions = LayoutOptions.Center }; + + stack.Children.Add(new Label() + { + VerticalOptions = LayoutOptions.Center, + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 1" + }); + + Content = stack; + + } + + WeakReference _page2Tracker; + + protected override async void OnAppearing() + { + base.OnAppearing(); + + if (_page2Tracker == null) + { + var page2 = new Page2(); + + _page2Tracker = new WeakReference(page2, false); + + await Task.Delay(1000); + await Navigation.PushModalAsync(page2); + + StartTrackPage2(); + } + } + + async void StartTrackPage2() + { + while (true) + { + ((Label)((StackLayout)Content).Children[0]).Text = + string.Format("Page1. But Page2 IsAlive = {0}", _page2Tracker.IsAlive); + await Task.Delay(1000); + GarbageCollectionHelper.Collect(); + } + } + + [Preserve(AllMembers = true)] + public class Page2 : FlyoutPage + { + public Page2() + { + Flyout = new Page() + { + Title = "Flyout", + IconImageSource = "Icon.png" + }; + Detail = new Page() { Title = "Detail" }; + } + + protected override async void OnAppearing() + { + base.OnAppearing(); + + await Task.Delay(1000); + await Navigation.PopModalAsync(); + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla31366.cs b/src/Controls/tests/TestCases/Issues/Bugzilla31366.cs new file mode 100644 index 000000000000..a9639e2948c7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla31366.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 31366, "Pushing and then popping a page modally causes ArgumentOutOfRangeException", + PlatformAffected.All)] + public class Bugzilla31366 : TestNavigationPage + { + protected override void Init() + { + var page1 = new ContentPage() { Title = "Page1" }; + + var successLabel = new Label(); + var startPopOnAppearing = new Button() { Text = "Start PopOnAppearing Test" }; + var startModalStack = new Button() { Text = "Start ModalStack Test" }; + + page1.Content = new StackLayout() + { + Children = { startPopOnAppearing, startModalStack, successLabel } + }; + + var popOnAppearing = new ContentPage() + { + Title = "PopOnAppearing", + Content = new StackLayout() + }; + + popOnAppearing.Appearing += async (sender, args) => + { + await Task.Yield(); + await popOnAppearing.Navigation.PopModalAsync(); + }; + + startPopOnAppearing.Clicked += async (sender, args) => + { + successLabel.Text = string.Empty; + + await page1.Navigation.PushModalAsync(popOnAppearing); + + successLabel.Text = "If this is visible, the PopOnAppearing test has passed."; + }; + + startModalStack.Clicked += async (sender, args) => + { + successLabel.Text = string.Empty; + + var intermediatePage = new ContentPage() + { + Content = new StackLayout() + { + Children = { + new Label () { Text = "If this is visible, the modal stack test has passed." } + } + } + }; + + await intermediatePage.Navigation.PushModalAsync(popOnAppearing); + + await page1.Navigation.PushModalAsync(intermediatePage); + }; + + PushAsync(page1); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla31395.cs b/src/Controls/tests/TestCases/Issues/Bugzilla31395.cs new file mode 100644 index 000000000000..275b35c894d4 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla31395.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 31395, "Crash when switching MainPage and using a Custom Render")] + public class Bugzilla31395 : TestContentPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + Content = new CustomContentView + { // Replace with ContentView and everything works fine + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + new Button { + Text = "Switch Main Page", + Command = new Command (() => SwitchMainPage ()) + } + } + } + }; + } + + void SwitchMainPage() + { + Application.Current.MainPage = new ContentPage { Content = new Label { Text = "Hello" } }; + } + + public class CustomContentView : ContentView + { + + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla31688.cs b/src/Controls/tests/TestCases/Issues/Bugzilla31688.cs new file mode 100644 index 000000000000..eaf47e551e65 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla31688.cs @@ -0,0 +1,116 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 31688, "'Navigation.InsertPageBefore()' does not work for more than two pages, \"throws java.lang.IndexOutOfBoundsException: index=3 count=2", PlatformAffected.Android)] + public class Bugzilla31688 : TestNavigationPage // or TestFlyoutPage, etc ... + { + MyMainPage page; + protected override async void Init() + { + page = new MyMainPage(); + await Navigation.PushAsync(page); + page.LoadAsync(); + } + + public class MyMainPage : ContentPage + { + public MyMainPage() + { + Content = new Label { Text = "My Main Page" }; + } + + public async void LoadAsync() + { + ActivityIndicatorPage aip = new ActivityIndicatorPage(); + await Navigation.PushAsync(aip); + + var page1 = await Page1.CreateAsync(); + Navigation.InsertPageBefore(page1, aip); + + var page2 = await Page2.CreateAsync(); + Navigation.InsertPageBefore(page2, aip); + + var page3 = await Page3.CreateAsync(); + Navigation.InsertPageBefore(page3, aip); + + + //// try to remove last page (with AcitivityIndicator) and here it bombs with the error: "java.lang.IndexOutOfBoundsException: index=3 count=2" + await Navigation.PopAsync(); + } + } + + public class Page1 : ContentPage + { + private Page1() + { + Content = new Label { Text = "Page 1" }; + } + + public static async Task CreateAsync() + { + var page = new Page1(); + await Task.Delay(TimeSpan.FromMilliseconds(200)); // simulate loading of state from DB + return page; + } + } + + public class Page2 : ContentPage + { + private Page2() + { + Content = new Label { Text = "Page 2" }; + } + + public static async Task CreateAsync() + { + var page = new Page2(); + await Task.Delay(TimeSpan.FromMilliseconds(200)); // simulate loading of state from DB + return page; + } + } + + class Page3 : ContentPage + { + private Page3() + { + Content = new Label { Text = "Page 3" }; + } + + public static async Task CreateAsync() + { + var page = new Page3(); + await Task.Delay(TimeSpan.FromMilliseconds(200)); // simulate loading of state from DB + return page; + } + } + + public class Page4 : ContentPage + { + private Page4() + { + Content = new Label { Text = "Page 4" }; + } + + public static async Task CreateAsync() + { + var page = new Page4(); + await Task.Delay(TimeSpan.FromMilliseconds(200)); // simulate loading of state from DB + return page; + } + } + + public class ActivityIndicatorPage : ContentPage + { + public ActivityIndicatorPage() + { + Content = new ActivityIndicator { IsRunning = true }; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla32206.cs b/src/Controls/tests/TestCases/Issues/Bugzilla32206.cs new file mode 100644 index 000000000000..f6663b13e4f2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla32206.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 32206, "ContextActions cause memory leak: Page is never destroyed", PlatformAffected.iOS)] + public class Bugzilla32206 : TestNavigationPage + { + protected override void Init() + { + PushAsync(new LandingPage32206()); + } + } + + [Preserve(AllMembers = true)] + public class LandingPage32206 : ContentPage + { + public static int Counter; + public Label Label; + + public LandingPage32206() + { + Label = new Label + { + Text = "Counter: " + Counter, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center + }; + + Content = new StackLayout + { + Orientation = StackOrientation.Vertical, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + Spacing = 15, + Children = + { + new Label + { + Text = "Click Push to show a ListView. When you hit the Back button, Counter will show the number of pages that have not been finalized yet." + + " If you click GC, the counter should be 0." + }, + Label, + new Button + { + Text = "GC", + AutomationId = "GC", + Command = new Command(o => + { + GarbageCollectionHelper.Collect(); + Label.Text = "Counter: " + Counter; + }) + }, + new Button + { + Text = "Push", + AutomationId = "Push", + Command = new Command(async o => + { + await Navigation.PushAsync(new ContentPage32206()); + }) + } + } + }; + } + + protected override void OnAppearing() + { + base.OnAppearing(); + + if (Label != null) + Label.Text = "Counter: " + Counter; + } + } + + [Preserve(AllMembers = true)] + public class ContentPage32206 : ContentPage + { + public ContentPage32206() + { + Interlocked.Increment(ref LandingPage32206.Counter); + System.Diagnostics.Debug.WriteLine("Page: " + LandingPage32206.Counter); + + Content = new ListView + { + ItemsSource = new List { "Apple", "Banana", "Cherry" }, + ItemTemplate = new DataTemplate(typeof(ViewCell32206)), + AutomationId = "ListView" + }; + } + + ~ContentPage32206() + { + Interlocked.Decrement(ref LandingPage32206.Counter); + System.Diagnostics.Debug.WriteLine("Page: " + LandingPage32206.Counter); + } + } + + [Preserve(AllMembers = true)] + public class ViewCell32206 : ViewCell + { + public ViewCell32206() + { + View = new Label(); + View.SetBinding(Label.TextProperty, "."); + ContextActions.Add(new MenuItem { Text = "Delete" }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla32615.cs b/src/Controls/tests/TestCases/Issues/Bugzilla32615.cs new file mode 100644 index 000000000000..b6ffb957a18e --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla32615.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 32615, "OnAppearing is not called on previous page when modal page is popped")] + public class Bugzilla32615 : TestContentPage // or TestFlyoutPage, etc ... + { + int _counter; + Label _textField; + protected override void Init() + { + var btnModal = new Button { AutomationId = "btnModal", Text = "open", HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; + btnModal.Clicked += async (sender, e) => await Navigation.PushModalAsync(new Bugzilla32615Page2()); + _textField = new Label { AutomationId = "lblCount" }; + var layout = new StackLayout(); + layout.Children.Add(btnModal); + layout.Children.Add(_textField); + // Initialize ui here instead of ctor + Content = layout; + } + + protected override void OnAppearing() + { + _textField.Text = _counter++.ToString(); + } + + class Bugzilla32615Page2 : ContentPage + { + public Bugzilla32615Page2() + { + var btnPop = new Button { AutomationId = "btnPop", Text = "pop", HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; + btnPop.Clicked += async (sender, e) => await Navigation.PopModalAsync(); + Content = btnPop; + } + + protected override void OnDisappearing() + { + System.Diagnostics.Debug.WriteLine("Disappearing Modal"); + base.OnDisappearing(); + } + + protected override void OnAppearing() + { + System.Diagnostics.Debug.WriteLine("Appearing Modal"); + base.OnAppearing(); + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla32830.cs b/src/Controls/tests/TestCases/Issues/Bugzilla32830.cs new file mode 100644 index 000000000000..14a89df0b5e2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla32830.cs @@ -0,0 +1,129 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + // Uses a custom renderer on Android to override SetupPageTransition. + // While these transitions are often desired, they can appear to cause the "flash" + // at the top and bottom of the screen that could be confused with the bug we're fixing. + public class NoFlashTestNavigationPage : TestNavigationPage + { + protected override void Init() + { + + } + } + + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 32830, "Hiding navigation bar causes layouts to shift during navigation", PlatformAffected.iOS)] + public class Bugzilla32830 : NoFlashTestNavigationPage + { + const string Button1 = "button1"; + const string Button2 = "button2"; + const string BottomLabel = "I am visible at the bottom of the page"; + + [Preserve(AllMembers = true)] + class Page1 : ContentPage + { + public Page1() + { + Title = "Page 1"; + BackgroundColor = Colors.Gray; + + var relativeLayout = new Compatibility.RelativeLayout { }; + + relativeLayout.Children.Add(new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 1", + TextColor = Colors.White + }, + new Button { + Text = "Go to page 2", + Command = new Command(async () => await Navigation.PushAsync(new Page2())), + AutomationId = Button1, + TextColor = Colors.White + }, + new Button { + Text = "Toggle Nav Bar", + Command = new Command(() => NavigationPage.SetHasNavigationBar(this, !NavigationPage.GetHasNavigationBar(this))), + TextColor = Colors.White + } + } + }, yConstraint: Compatibility.Constraint.RelativeToParent(parent => { return parent.Y; })); + + relativeLayout.Children.Add(new Label + { + Text = BottomLabel, + TextColor = Colors.White + }, yConstraint: Compatibility.Constraint.RelativeToParent(parent => { return parent.Height - 30; })); + + Content = relativeLayout; + + NavigationPage.SetHasNavigationBar(this, false); + } + } + + [Preserve(AllMembers = true)] + class Page2 : ContentPage + { + public Page2() + { + Title = "Page 2"; + BackgroundColor = Colors.Gray; + var relativeLayout = new Compatibility.RelativeLayout { }; + relativeLayout.Children.Add(new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 2", + TextColor = Colors.White + }, + new Button { + Text = "Go to tabs", + AutomationId = Button2, + Command = new Command(async () => await Navigation.PushAsync(new MyTabs())), + TextColor = Colors.White + }, + new Button { + Text = "Toggle Nav Bar", + Command = new Command(() => NavigationPage.SetHasNavigationBar(this, !NavigationPage.GetHasNavigationBar(this))), + TextColor = Colors.White + } + } + }, yConstraint: Compatibility.Constraint.RelativeToParent(parent => { return parent.Y; })); + + relativeLayout.Children.Add(new Label + { + Text = BottomLabel, + TextColor = Colors.White + }, yConstraint: Compatibility.Constraint.RelativeToParent(parent => { return parent.Height - 30; })); + + Content = relativeLayout; + } + } + + class MyTabs : TabbedPage + { + public MyTabs() + { + Children.Add(new NavigationPage(new Page1())); + Children.Add(new Page2()); + } + } + + protected override void Init() + { + Navigation.PushAsync(new Page1()); + + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla32898.cs b/src/Controls/tests/TestCases/Issues/Bugzilla32898.cs new file mode 100644 index 000000000000..b692b62e75f2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla32898.cs @@ -0,0 +1,78 @@ +using System; +using System.Diagnostics; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 32898, "Memory leak when TabbedPage is popped out ")] + public class Bugzilla32898 : TestContentPage + { + WeakReference _page2Tracker; + WeakReference _tabTracker; + + Label _result; + const string Success = "Success"; + const string Fail = "Fail"; + const int Timeout = 20000; + + protected override void Init() + { + var stack = new StackLayout { VerticalOptions = LayoutOptions.Center }; + + _result = new Label + { + VerticalOptions = LayoutOptions.Center, + HorizontalTextAlignment = TextAlignment.Center, + Text = "Page 1" + }; + + stack.Children.Add(_result); + + Content = stack; + } + + protected override async void OnAppearing() + { + base.OnAppearing(); + + if (_page2Tracker == null) + { + var page2 = new TabbedPage { Children = { new ContentPage { Title = "tab" } } }; + page2.Appearing += async delegate + { + await Task.Delay(1000); + await page2.Navigation.PopModalAsync(); + }; + + _page2Tracker = new WeakReference(page2, false); + _tabTracker = new WeakReference(page2.Children[0], false); + + await Task.Delay(1000); + await Navigation.PushModalAsync(page2); + + StartTrackPage2(); + } + } + + async void StartTrackPage2() + { + var watch = new Stopwatch(); + watch.Start(); + + // We'll let this run until the references are dead or timeout has passed + while (_page2Tracker.IsAlive && _tabTracker.IsAlive && watch.ElapsedMilliseconds < Timeout) + { + await Task.Delay(1000); + GarbageCollectionHelper.Collect(); + } + + watch.Stop(); + + _result.Text = _page2Tracker.IsAlive || _tabTracker.IsAlive ? Fail : Success; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla34007.cs b/src/Controls/tests/TestCases/Issues/Bugzilla34007.cs new file mode 100644 index 000000000000..a9bd860f89f4 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla34007.cs @@ -0,0 +1,66 @@ +using System; +using System.Xml.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 34007, "Z order drawing of children views are different on Android, iOS, Win", PlatformAffected.Android | PlatformAffected.iOS)] + public class Bugzilla34007 : TestContentPage + { + protected override void Init() + { + var grid = new Grid(); + + var button0 = new Button + { + Text = "Button 0", + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill + }; + + var button1 = new Button + { + Text = "Button 1", + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill + }; + + var lastButtonTappedLabel = new Label(); + + Action reorder = () => + { + // Get the last item in the grid + var item = grid.Children[1]; + + // Remove it + grid.Children.RemoveAt(1); + + // And put it back as the 0th item + grid.Children.Insert(0, item); + }; + + button0.Clicked += (sender, args) => + { + lastButtonTappedLabel.Text = "Button 0 was tapped last"; + }; + + button1.Clicked += (sender, args) => + { + lastButtonTappedLabel.Text = "Button 1 was tapped last"; + + reorder(); + }; + + grid.Children.Add(button0, 0, 0); + grid.Children.Add(button1, 0, 0); + + Content = new StackLayout + { + Children = { grid, lastButtonTappedLabel } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla34061.cs b/src/Controls/tests/TestCases/Issues/Bugzilla34061.cs new file mode 100644 index 000000000000..059893adda74 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla34061.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 34061, "RelativeLayout - First child added after page display does not appear")] + public class Bugzilla34061 : TestContentPage + { + Compatibility.RelativeLayout _layout; + + protected override void Init() + { + _layout = new Compatibility.RelativeLayout(); + var label = new Label { Text = "Some content goes here", HorizontalOptions = LayoutOptions.Center }; + + var addButton = new Button { Text = "Add Popover", AutomationId = "btnAdd" }; + addButton.Clicked += (s, ea) => AddPopover(); + + var stack = new StackLayout + { + Orientation = StackOrientation.Vertical, + Children = { + label, + addButton + }, + }; + + _layout.Children.Add(stack, + Compatibility.Constraint.Constant(0), + Compatibility.Constraint.Constant(0), + Compatibility.Constraint.RelativeToParent(p => p.Width), + Compatibility.Constraint.RelativeToParent(p => p.Height)); + + Content = _layout; + } + + void AddPopover() + { + var newView = new Button + { + BackgroundColor = Color.FromRgba(64, 64, 64, 64), + Text = "Remove Me", + AutomationId = "btnRemoveMe" + }; + newView.Clicked += (s, ea) => RemovePopover(newView); + + _layout.Children.Add( + newView, + Compatibility.Constraint.Constant(0), + Compatibility.Constraint.RelativeToParent(p => p.Height / 2), + Compatibility.Constraint.RelativeToParent(p => p.Width), + Compatibility.Constraint.RelativeToParent(p => p.Height / 2)); + } + + void RemovePopover(View view) + { + _layout.Children.Remove(view); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla35472.cs b/src/Controls/tests/TestCases/Issues/Bugzilla35472.cs new file mode 100644 index 000000000000..a659b8cdafaf --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla35472.cs @@ -0,0 +1,79 @@ +using System; +using System.Diagnostics; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 35472, "PopAsync during ScrollToAsync throws NullReferenceException")] + public class Bugzilla35472 : TestNavigationPage + { + protected override void Init() + { + // Set up the scroll viewer page + var scrollToButton = new Button() { Text = "Now push this button" }; + + var stackLayout = new StackLayout(); + + stackLayout.Children.Add(scrollToButton); + + for (int n = 0; n < 100; n++) + { + stackLayout.Children.Add(new Label() { Text = n.ToString() }); + } + + var scrollView = new ScrollView() + { + Content = stackLayout + }; + + var pageWithScrollView = new ContentPage() + { + Content = scrollView + }; + + // Set up the start page + var goButton = new Button() + { + Text = "Push this button" + }; + + var successLabel = new Label() { Text = "The test has passed", IsVisible = false }; + + var startPage = new ContentPage() + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + goButton, + successLabel + } + } + }; + + PushAsync(startPage); + + goButton.Clicked += (sender, args) => Navigation.PushAsync(pageWithScrollView); + + scrollToButton.Clicked += async (sender, args) => + { + try + { +#pragma warning disable 4014 + // Deliberately not awaited so we can simulate a user navigating back before the scroll is finished + scrollView.ScrollToAsync(0, 1500, true); +#pragma warning restore 4014 + await Navigation.PopAsync(); + successLabel.IsVisible = true; + } + catch (Exception ex) + { + Debug.WriteLine(ex); + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla35477.cs b/src/Controls/tests/TestCases/Issues/Bugzilla35477.cs new file mode 100644 index 000000000000..d760aac5d907 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla35477.cs @@ -0,0 +1,35 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 35477, "Tapped event does not fire when added to Frame in Android AppCompat", + PlatformAffected.Android)] + public class Bugzilla35477 : TestContentPage + { + protected override void Init() + { + var instructions = new Label + { + Text = "Tap the frame below. The label with the text 'No taps yet' should change its text to 'Frame was tapped'." + }; + var frame = new Frame() { }; + var frameLabel = new Label() { Text = "Tap here" }; + + frame.Content = new StackLayout() { Children = { frameLabel } }; + + var label = new Label { Text = "No taps yet" }; + + var rec = new TapGestureRecognizer { NumberOfTapsRequired = 1 }; + rec.Tapped += (s, e) => { label.Text = "Frame was tapped"; }; + frame.GestureRecognizers.Add(rec); + + Content = new StackLayout + { + Children = { instructions, frame, label } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla35733.cs b/src/Controls/tests/TestCases/Issues/Bugzilla35733.cs new file mode 100644 index 000000000000..da837b24cfe2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla35733.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 35733, "iOS WebView crashes when loading an URL with encoded parameters", PlatformAffected.iOS)] + public class Bugzilla35733 : TestContentPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + var thisDoesNotWorkButton = new Button + { + Text = "This will crash", + AutomationId = "btnGo" + + }; + thisDoesNotWorkButton.Clicked += async (object sender, EventArgs e) => await ShowLocation("KÅRA"); + + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + thisDoesNotWorkButton + } + }; + } + + async Task ShowLocation(string locationString) + { + var stringUri = $"https://raw.githubusercontent.com/xamarin/Xamarin.Forms/main/README.md?l=en&px_location={Uri.EscapeDataString(locationString)}"; + + var uri = new Uri(stringUri); + var webPage = new ContentPage + { + Title = "WebViewTest", + Content = new WebView + { + Source = uri + } + }; + await Navigation.PushAsync(webPage); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla35736.cs b/src/Controls/tests/TestCases/Issues/Bugzilla35736.cs new file mode 100644 index 000000000000..57c9d9f3aaf6 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla35736.cs @@ -0,0 +1,39 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 35736, "[iOS] Editor does not update Text value from autocorrect when losing focus", PlatformAffected.iOS)] + public class Bugzilla35736 : TestContentPage + { + protected override void Init() + { + var editor = new Editor + { + AutomationId = "Bugzilla35736Editor" + }; + var label = new Label + { + AutomationId = "Bugzilla35736Label", + Text = "" + }; + + Content = new StackLayout + { + Children = + { + editor, + label, + new Button + { + AutomationId = "Bugzilla35736Button", + Text = "Click to set label text", + Command = new Command(() => { label.Text = editor.Text; }) + } + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36009.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36009.cs new file mode 100644 index 000000000000..282c745073e1 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36009.cs @@ -0,0 +1,48 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36009, "Children of Layouts with data bound IsVisible are not displayed")] + public class Bugzilla36009 : TestContentPage // or TestFlyoutPage, etc ... + { + [Preserve(AllMembers = true)] + public class SampleViewModel : ViewModelBase + { + public bool IsContentVisible + { + get { return GetProperty(); } + set { SetProperty(value); } + } + } + + protected override void Init() + { + var boxview = new BoxView { BackgroundColor = Colors.Aqua, AutomationId = "Victory" }; + + var contentView = new ContentView + { + Content = boxview + }; + + contentView.SetBinding(IsVisibleProperty, "IsContentVisible"); + + var layout = new AbsoluteLayout + { + Children = { contentView } + }; + + Content = layout; + + var vm = new SampleViewModel(); + + BindingContext = vm; + + vm.IsContentVisible = true; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36559.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36559.cs new file mode 100644 index 000000000000..d7d6e415d11c --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36559.cs @@ -0,0 +1,40 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36559, "[WP] Navigating to a ContentPage with a Grid inside a TableView affects Entry heights")] + public class Bugzilla36559 : TestContentPage + { + protected override void Init() + { + var label = new Label { Text = "Label" }; + var entry = new Entry { AutomationId = "entry" }; + var grid = new Grid(); + + grid.Children.Add(label, 0, 0); + grid.Children.Add(entry, 1, 0); + var tableView = new TableView + { + Root = new TableRoot + { + new TableSection + { + new ViewCell + { + View = grid + } + } + } + }; + + Content = new StackLayout + { + Children = { tableView } + }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36703.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36703.cs new file mode 100644 index 000000000000..7d9dcddb90b2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36703.cs @@ -0,0 +1,54 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36703, + "TapGestureRecognizer inside initially disable Image will never fire Tapped event", PlatformAffected.All)] + public class Bugzilla36703 : TestContentPage + { + const string TestImage = "testimage"; + const string Success = "Success"; + const string Toggle = "toggle"; + const string Testing = "Testing..."; + + protected override void Init() + { + var image = new Image { Source = "coffee.png", IsEnabled = false, AutomationId = TestImage }; + var button = new Button { Text = $"Toggle IsEnabled (now {image.IsEnabled})", AutomationId = Toggle }; + var resultLabel = new Label { Text = "Testing..." }; + var instructions = new Label + { + Text = $"Tap the image. The '{Testing}' label should remain unchanged. " + + $"Tap the 'Toggle IsEnabled' button. Now tap the image again." + + $" The {Testing} Label should change its text to {Success}." + }; + + button.Clicked += (sender, args) => + { + image.IsEnabled = !image.IsEnabled; + button.Text = $"Toggle IsEnabled (now {image.IsEnabled})"; + }; + + Content = new StackLayout + { + Padding = new Thickness(0, 20, 0, 0), + Children = + { + instructions, resultLabel, + image, button + } + }; + + var tapGestureRecognizer = new TapGestureRecognizer(); + tapGestureRecognizer.Tapped += delegate + { + resultLabel.Text = Success; + }; + + image.GestureRecognizers.Add(tapGestureRecognizer); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36780.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36780.cs new file mode 100644 index 000000000000..12f9a183eb54 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36780.cs @@ -0,0 +1,62 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36780, "[iOS] Multiple TapGestureRecognizers on an Object Are Not Fired", PlatformAffected.iOS)] + public class Bugzilla36780 : TestContentPage + { + const string Gesture1Success = "Gesture1Success"; + const string Gesture2Success = "Gesture2Success"; + const string Gesture3Success = "Gesture3Success"; + const string Waiting = "Waiting"; + const string TestImage = "TestImage"; + + protected override void Init() + { + var gesture1Label = new Label { FontSize = 18, Text = Waiting }; + var gesture2Label = new Label { FontSize = 18, Text = Waiting }; + var gesture3Label = new Label { FontSize = 18, Text = Waiting }; + + var testImage = new Image { Source = "coffee.png", AutomationId = TestImage, HeightRequest = 75 }; + + testImage.GestureRecognizers.Add(new TapGestureRecognizer + { + Command = new Command(() => + { + gesture1Label.Text = Gesture1Success; + }) + }); + + testImage.GestureRecognizers.Add(new TapGestureRecognizer + { + Command = new Command(() => + { + gesture2Label.Text = Gesture2Success; + }) + }); + + testImage.GestureRecognizers.Add(new TapGestureRecognizer + { + Command = new Command(() => + { + gesture3Label.Text = Gesture3Success; + }) + }); + + Content = new StackLayout + { + Padding = new Thickness(0, 20, 0, 0), + Children = + { + gesture1Label, + gesture2Label, + gesture3Label, + testImage + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36788.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36788.cs new file mode 100644 index 000000000000..285e5347c19f --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36788.cs @@ -0,0 +1,119 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36788, "Truncation Issues with Relative Layouts")] + public class Bugzilla36788 : TestContentPage // or TestFlyoutPage, etc ... + { + Label _resultLabel; + Label _testLabel; + View _container; + + protected override void Init() + { + // Initialize ui here instead of ctor + var stackLayout = new StackLayout + { + Spacing = 8 + }; + + var longString = "Very long text in single line to be truncated at tail. Adding extra text to make sure it gets truncated. And even more extra text because otherwise the test might fail if we're in, say, landscape orientation rather than portrait."; + + var contentView = new ContentView + { + Padding = 16, + BackgroundColor = Colors.Gray, + Content = new Label + { + BackgroundColor = Colors.Aqua, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + } + }; + + stackLayout.Children.Add(contentView); + + contentView = new ContentView + { + Padding = 16, + BackgroundColor = Colors.Gray, + Content = new Compatibility.RelativeLayout + { + BackgroundColor = Colors.Navy, + Children = { + {new Label { + BackgroundColor = Colors.Blue, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (0)}, + {new Label { + BackgroundColor = Colors.Fuchsia, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (0), Compatibility.Constraint.Constant (40)}, + {new Label { + BackgroundColor = Colors.Fuchsia, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (10), Compatibility.Constraint.Constant (80)}, + } + } + }; + + stackLayout.Children.Add(contentView); + + contentView = new ContentView + { + Padding = 16, + BackgroundColor = Colors.Gray, + IsClippedToBounds = true, + Content = _container = new Compatibility.RelativeLayout + { + IsClippedToBounds = true, + BackgroundColor = Colors.Navy, + Children = { + {_testLabel = new Label { + BackgroundColor = Colors.Blue, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (0)}, + {new Label { + BackgroundColor = Colors.Fuchsia, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (0), Compatibility.Constraint.Constant (40)}, + {new Label { + BackgroundColor = Colors.Fuchsia, + Text = longString, + LineBreakMode = LineBreakMode.TailTruncation + }, Compatibility.Constraint.Constant (10), Compatibility.Constraint.Constant (80)}, + } + } + }; + + stackLayout.Children.Add(contentView); + + _resultLabel = new Label(); + stackLayout.Children.Add(_resultLabel); + + Content = stackLayout; + } + + protected override async void OnAppearing() + { + base.OnAppearing(); + await Task.Delay(200); + + double fuzzFactor = 15; // labels sometimes overflow slightly, thanks hinting + + if (Math.Abs(_testLabel.Width - _container.Width) < fuzzFactor) + _resultLabel.Text = "Passed"; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla36802.cs b/src/Controls/tests/TestCases/Issues/Bugzilla36802.cs new file mode 100644 index 000000000000..981c004bc663 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla36802.cs @@ -0,0 +1,78 @@ +using System.Collections.ObjectModel; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 36802, "[iOS] AccessoryView Partially Hidden When Using RecycleElement and GroupShortName", PlatformAffected.iOS)] + public class Bugzilla36802 : TestContentPage + { + const string Instructions = "On iOS, all the list items below should have an AccessoryView visible. If any are not visible or are covered by the section index list then this test has failed."; + ObservableCollection grouped { get; set; } + ListView lstView; + + public class AccessoryViewCell : ViewCell + { + public AccessoryViewCell() + { + var label = new Label(); + label.SetBinding(Label.TextProperty, "."); + View = label; + } + } + + public class GroupedItem : ObservableCollection + { + public string LongName { get; set; } + public string ShortName { get; set; } + } + + protected override void Init() + { + var label = new Label { Text = Instructions, AutomationId = "TestReady" }; + grouped = new ObservableCollection(); + lstView = new ListView(ListViewCachingStrategy.RecycleElement) + { + IsGroupingEnabled = true, + ItemTemplate = new DataTemplate(typeof(AccessoryViewCell)), + ItemsSource = grouped, + GroupDisplayBinding = new Binding("LongName"), + GroupShortNameBinding = new Binding("ShortName") + }; + + var grp1 = new GroupedItem() { LongName = "Group 1", ShortName = "1" }; + var grp2 = new GroupedItem() { LongName = "Group 2", ShortName = "2" }; + + for (int i = 1; i < 4; i++) + { + grp1.Add($"Item #{i}"); + grp2.Add($"Item #{i}"); + } + + grouped.Add(grp1); + grouped.Add(grp2); + + Content = new StackLayout + { + Children = { + label, + lstView + } + }; + } + +#if (UITEST && __IOS__) + [Test] + [Category(UITestCategories.ManualReview)] + [Compatibility.UITests.FailsOnMauiIOS] + public void Bugzilla36802Test() + { + RunningApp.WaitForElement("TestReady"); + RunningApp.Screenshot("AccessoryView partially hidden test"); + } +#endif + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla37625.cs b/src/Controls/tests/TestCases/Issues/Bugzilla37625.cs new file mode 100644 index 000000000000..4f753bae6ee7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla37625.cs @@ -0,0 +1,26 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 37625, "App crashes when quickly adding/removing Image views (Windows UWP)")] + public class Bugzilla37625 : TestContentPage + { + protected override async void Init() + { + int retry = 5; + while (retry-- >= 0) + { + var imageUri = new Uri("https://raw.githubusercontent.com/xamarin/Xamarin.Forms/main/Microsoft.Maui.Controls.ControlGallery.Android/Assets/WebImages/XamarinLogo.png"); + Content = new Image() { Source = new UriImageSource() { Uri = imageUri }, BackgroundColor = Colors.Black, AutomationId = "success" }; + + await Task.Delay(50); + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla38723.cs b/src/Controls/tests/TestCases/Issues/Bugzilla38723.cs new file mode 100644 index 000000000000..8f4ed92380e5 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla38723.cs @@ -0,0 +1,51 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 38723, "Update Content in Picker's SelectedIndexChanged event causes NullReferenceException", PlatformAffected.All)] + public class Bugzilla38723 : TestContentPage + { + protected override void Init() + { + var label = new Label + { + Text = "NoSelected" + }; + + var picker = new Picker + { + Title = "Options", + ItemsSource = new[] { "option1", "option2", "option3" } + }; + + picker.SelectedIndexChanged += (sender, args) => + { + label.Text = "Selected"; + Content = label; + }; + + var button = new Button + { + Text = "SELECT" + }; + + button.Clicked += (sender, args) => + { + picker.SelectedIndex = 0; + }; + + Content = new StackLayout + { + Children = + { + label, + picker, + button + } + }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla38989.cs b/src/Controls/tests/TestCases/Issues/Bugzilla38989.cs new file mode 100644 index 000000000000..69979675e3e2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla38989.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 38989, "[Android] NullReferenceException when using a custom ViewCellRenderer ", + PlatformAffected.Android)] + public class Bugzilla38989 : TestContentPage + { + const string Success = "If you can see this, the test passed."; + + protected override void Init() + { + var successLabel = new Label { Text = Success }; + + var lv = new ListView(); + var items = new List { "data", "does not", "matter" }; + + lv.ItemTemplate = new DataTemplate(typeof(_38989CustomViewCell)); + + lv.ItemsSource = items; + + Content = new StackLayout { Children = { successLabel, lv } }; + } + + [Preserve(AllMembers = true)] + public class _38989CustomViewCell : ViewCell + { + public _38989CustomViewCell() + { + var label = new Label(); + label.SetBinding(Label.TextProperty, "."); + + View = label; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39489.cs b/src/Controls/tests/TestCases/Issues/Bugzilla39489.cs new file mode 100644 index 000000000000..3ef4624ce797 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39489.cs @@ -0,0 +1,79 @@ +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Maps; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39489, "Memory leak when using NavigationPage with Maps", PlatformAffected.Android | PlatformAffected.iOS)] + public class Bugzilla39489 : TestNavigationPage + { + protected override void Init() + { + PushAsync(new Bz39489Content()); + } + } + + public class Bz39489Map : Map + { + static int s_count; + + public Bz39489Map() + { + Interlocked.Increment(ref s_count); + Debug.WriteLine($"++++++++ Bz39489Map : Constructor, count is {s_count}"); + } + + ~Bz39489Map() + { + Interlocked.Decrement(ref s_count); + Debug.WriteLine($"-------- Bz39489Map: Destructor, count is {s_count}"); + } + } + + [Preserve(AllMembers = true)] + public class Bz39489Content : ContentPage + { + static int s_count; + + public Bz39489Content() + { + Interlocked.Increment(ref s_count); + Debug.WriteLine($">>>>> Bz39489Content Bz39489Content 54: Constructor, count is {s_count}"); + + var button = new Button { Text = "New Page" }; + + var gcbutton = new Button { Text = "GC" }; + + var map = new Bz39489Map(); + + button.Clicked += Button_Clicked; + gcbutton.Clicked += GCbutton_Clicked; + + Content = new StackLayout { Children = { button, gcbutton, map } }; + } + + void GCbutton_Clicked(object sender, EventArgs e) + { + System.Diagnostics.Debug.WriteLine(">>>>>>>> Running Garbage Collection"); + GarbageCollectionHelper.Collect(); + System.Diagnostics.Debug.WriteLine($">>>>>>>> GC.GetTotalMemory = {GC.GetTotalMemory(true):n0}"); + } + + void Button_Clicked(object sender, EventArgs e) + { + Navigation.PushAsync(new Bz39489Content()); + } + + ~Bz39489Content() + { + Interlocked.Decrement(ref s_count); + Debug.WriteLine($">>>>> Bz39489Content ~Bz39489Content 82: Destructor, count is {s_count}"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml b/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml new file mode 100644 index 000000000000..3c8aa6ed3c6c --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + 80 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml.cs b/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml.cs new file mode 100644 index 000000000000..547429927b87 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39636.xaml.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39636, "Cannot use XamlC with OnPlatform in resources, it throws System.InvalidCastException", PlatformAffected.All)] +#if APP + [XamlCompilation(XamlCompilationOptions.Compile)] +#endif + public partial class Bugzilla39636 : TestContentPage + { + public Bugzilla39636() + { +#if APP + InitializeComponent(); +#endif + } + + protected override void Init() + { + + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39668.cs b/src/Controls/tests/TestCases/Issues/Bugzilla39668.cs new file mode 100644 index 000000000000..428d5527c9c5 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39668.cs @@ -0,0 +1,42 @@ +using System; +using System.Linq; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39668, "Overriding ListView.CreateDefault Does Not Work on Windows", PlatformAffected.WinRT)] + public class Bugzilla39668 : TestContentPage + { + [Preserve(AllMembers = true)] + public class CustomListView : ListView + { + protected override Cell CreateDefault(object item) + { + var cell = new ViewCell(); + + cell.View = new StackLayout + { + BackgroundColor = Colors.Green, + Children = { + new Label { Text = "Success" } + } + }; + + return cell; + } + } + + protected override void Init() + { + CustomListView lv = new CustomListView() + { + ItemsSource = Enumerable.Range(0, 10) + }; + Content = new StackLayout { Children = { new Label { Text = "If the ListView does not have green Cells, this test has failed." }, lv } }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39702.cs b/src/Controls/tests/TestCases/Issues/Bugzilla39702.cs new file mode 100644 index 000000000000..97cda4c82b56 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39702.cs @@ -0,0 +1,49 @@ +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39702, "Cannot enter text when Entry is focus()'d from an editor completed event")] + public class Bugzilla39702 : TestContentPage + { + const string TheEntry = "TheEntry"; + const string Success = "Success"; + + protected override async void Init() + { + Title = "focus test"; + var editor = new Editor(); + var entry = new Entry { AutomationId = TheEntry }; + var result = new Label(); + + var instructions = new Label + { + Text = "Wait 4 seconds; the Entry (third control from the top) should be focused, and the keyboard" + + " should be visible. Typing on the keyboard should enter text into the Entry." + + " If the typing does not enter text into the Entry, this test has failed." + }; + + editor.Unfocused += (sender, e) => entry.Focus(); + entry.TextChanged += (sender, args) => result.Text = args.NewTextValue; + + Content = new StackLayout + { + Children = + { + instructions, + editor, + entry, + result + } + }; + + await Task.Delay(2000); + editor.Focus(); + await Task.Delay(1000); + editor.Unfocus(); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla39821.cs b/src/Controls/tests/TestCases/Issues/Bugzilla39821.cs new file mode 100644 index 000000000000..464e7f7bfba6 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla39821.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 39821, "ViewExtension.TranslateTo cannot be invoked on Main thread")] + public class Bugzilla39821 : TestContentPage + { + protected override void Init() + { + var box = new BoxView { BackgroundColor = Colors.Blue, WidthRequest = 50, HeightRequest = 50, HorizontalOptions = LayoutOptions.Center }; + + var instructions = new Label { Text = "Click the 'Animate' button to run animation on the box. If the animations complete without crashing, this test has passed." }; + + var success = new Label { Text = "Success", IsVisible = false }; + + var button = new Button() { Text = "Animate" }; + + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Fill, + HorizontalOptions = LayoutOptions.Fill, + Children = + { + instructions, + success, + button, + new AbsoluteLayout + { + Children = { box }, + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill + } + } + }; + + button.Clicked += async (sender, args) => + { + // Run a bunch of animations from the thread pool + await Task.WhenAll( + Task.Run(async () => await Translate(box)), + Task.Run(async () => await CheckTranslateRunning(box)), + Task.Run(async () => await AnimateScale(box)), + Task.Run(async () => await Rotate(box)), + Task.Run(async () => await Animate(box)), + Task.Run(async () => await Kinetic(box)), + Task.Run(async () => await Cancel(box)) + ); + + success.IsVisible = true; + }; + } + +#pragma warning disable 1998 // considered for removal + async Task CheckTranslateRunning(BoxView box) +#pragma warning restore 1998 + { + Debug.WriteLine(box.AnimationIsRunning("TranslateTo") ? "Translate is running" : "Translate is not running"); + } + + static async Task Translate(BoxView box) + { + var currentX = box.X; + var currentY = box.Y; + + await box.TranslateTo(currentX, currentY + 100); + await box.TranslateTo(currentX, currentY); + } + + static async Task AnimateScale(BoxView box) + { + await box.ScaleTo(2); + await box.ScaleTo(0.5); + } + + static async Task Rotate(BoxView box) + { + await box.RelRotateTo(360); + } + +#pragma warning disable 1998 // considered for removal + async Task Cancel(BoxView box) +#pragma warning restore 1998 + { + box.AbortAnimation("animate"); + box.AbortAnimation("kinetic"); + } + +#pragma warning disable 1998 // considered for removal + async Task Animate(BoxView box) +#pragma warning restore 1998 + { + box.Animate("animate", d => d, d => { }, 100, 1); + } + +#pragma warning disable 1998 // considered for removal + async Task Kinetic(BoxView box) +#pragma warning restore 1998 + { + var resultList = new List>(); + + box.AnimateKinetic("kinetic", (distance, velocity) => + { + resultList.Add(new Tuple(distance, velocity)); + return true; + }, 100, 1); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla40005.cs b/src/Controls/tests/TestCases/Issues/Bugzilla40005.cs new file mode 100644 index 000000000000..84274eaa4277 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla40005.cs @@ -0,0 +1,130 @@ +using System; +using System.Diagnostics; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 40005, "Navigation Bar back button does not show when using InsertPageBefore")] + public class Bugzilla40005 : TestContentPage // or TestFlyoutPage, etc ... + { + public const string GoToPage2 = "Go to Page 2"; + public const string PageOneLabel = "Page 1"; + public const string PageTwoLabel = "Page 2"; + public const string InsertedPageLabel = "Inserted page"; + public const string TestInstructions = "Click " + GoToPage2 + " and you should still see a back bar button"; + + public Bugzilla40005() + { + } + + protected override void Init() + { + Application.Current.MainPage = new NavigationPage(new Page1()); + } + + public class Page1 : ContentPage + { + bool pageInserted; + + public Page1() + { + var btn = new Button() + { + Text = GoToPage2 + }; + btn.Clicked += async (sender, e) => + { + await Navigation.PushAsync(new Page2()); + }; + + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = + { + new Label + { + HorizontalTextAlignment = TextAlignment.Center, + Text = PageOneLabel + }, + btn, + new Label + { + HorizontalTextAlignment = TextAlignment.Center, + Text = TestInstructions + } + } + }; + } + + protected override void OnAppearing() + { + base.OnAppearing(); + if (!pageInserted) + { + Navigation.InsertPageBefore(new InsertedPage(), this); + pageInserted = true; + } + } + + protected override bool OnBackButtonPressed() + { + Debug.WriteLine($"Hardware BackButton Pressed on {PageOneLabel}"); + return base.OnBackButtonPressed(); + } + } + + public class InsertedPage : ContentPage + { + public InsertedPage() + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = + { + new Label + { + HorizontalTextAlignment = TextAlignment.Center, + Text = InsertedPageLabel + } + } + }; + } + + protected override bool OnBackButtonPressed() + { + Debug.WriteLine($"Hardware BackButton Pressed on {InsertedPageLabel}"); + return base.OnBackButtonPressed(); + } + } + + public class Page2 : ContentPage + { + public Page2() + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = + { + new Label + { + HorizontalTextAlignment = TextAlignment.Center, + Text = PageTwoLabel + } + } + }; + } + + protected override bool OnBackButtonPressed() + { + Debug.WriteLine($"Hardware BackButton Pressed on {PageTwoLabel}"); + return base.OnBackButtonPressed(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla41205.cs b/src/Controls/tests/TestCases/Issues/Bugzilla41205.cs new file mode 100644 index 000000000000..08f77a92087e --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla41205.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 41205, "UWP CreateDefault passes string instead of object")] + public class Bugzilla41205 : TestContentPage + { + const string _success = "Pass"; + + [Preserve(AllMembers = true)] + public class ViewModel + { + public string Text { get { return _success; } } + } + + [Preserve(AllMembers = true)] + public class CustomListView : ListView + { + protected override Cell CreateDefault(object item) + { + if (item is ViewModel) + { + var newTextCell = new TextCell(); + newTextCell.SetBinding(TextCell.TextProperty, nameof(ViewModel.Text)); + return newTextCell; + } + return base.CreateDefault("Fail"); + } + } + + protected override void Init() + { + var listView = new CustomListView + { + ItemsSource = new[] + { + new ViewModel(), + new ViewModel(), + } + }; + + Content = listView; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla41600.cs b/src/Controls/tests/TestCases/Issues/Bugzilla41600.cs new file mode 100644 index 000000000000..5239597ae377 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla41600.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 41600, "[Android] Invalid item param value for ScrollTo throws an error", PlatformAffected.Android)] + public class Bugzilla41600 : TestContentPage + { + const string _btnScrollToNonExistentItem = "btnScrollToNonExistentItem"; + const string _btnScrollToExistentItem = "btnScrollToExistentItem"; + const string _firstListItem = "0"; + const string _middleListItem = "15"; + + protected override void Init() + { + var items = new List(); + for (var i = 0; i <= 30; i++) + items.Add(i.ToString()); + + var listView = new ListView + { + ItemsSource = items + }; + Content = new StackLayout + { + Children = + { + listView, + new Button + { + AutomationId = _btnScrollToNonExistentItem, + Text = "Click for ScrollTo (should do nothing)", + Command = new Command(() => + { + listView.ScrollTo("Hello", ScrollToPosition.Start, true); + }) + }, + new Button + { + AutomationId = _btnScrollToExistentItem, + Text = "Click for ScrollTo (should go to 15)", + Command = new Command(() => + { + listView.ScrollTo(_middleListItem, ScrollToPosition.Start, false); + }) + } + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla41619.cs b/src/Controls/tests/TestCases/Issues/Bugzilla41619.cs new file mode 100644 index 000000000000..78b7d31d70b2 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla41619.cs @@ -0,0 +1,60 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 41619, "[WinRT/UWP] Slider binding works incorrectly", PlatformAffected.WinRT)] + public class Bugzilla41619 : TestContentPage + { + const double _success = 6; + protected override void Init() + { + var vm = new Bugzilla41619ViewModel(); + BindingContext = vm; + var label = new Label(); + label.SetBinding(Label.TextProperty, "SliderValue"); + var slider = new Slider + { + Maximum = 10, + Minimum = 1, + }; + slider.SetBinding(Slider.ValueProperty, "SliderValue", BindingMode.TwoWay); + Content = new StackLayout + { + Children = + { + label, + slider, + new Label { Text = $"The initial slider value above should be {_success}." } + } + }; + } + + [Preserve(AllMembers = true)] + class Bugzilla41619ViewModel : INotifyPropertyChanged + { + private double _sliderValue = _success; + + public double SliderValue + { + get { return _sliderValue; } + set + { + _sliderValue = value; + OnPropertyChanged(); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla41842.cs b/src/Controls/tests/TestCases/Issues/Bugzilla41842.cs new file mode 100644 index 000000000000..ba4cdca6c9cd --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla41842.cs @@ -0,0 +1,22 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 41842, "Set FlyoutPage.Detail = New Page() twice will crash the application when set FlyoutLayoutBehavior = FlyoutLayoutBehavior.Split", PlatformAffected.WinRT)] + public class Bugzilla41842 : TestFlyoutPage + { + protected override void Init() + { + FlyoutLayoutBehavior = FlyoutLayoutBehavior.Split; + + Flyout = new Page() { Title = "Flyout" }; + + Detail = new NavigationPage(new Page()); + Detail = new NavigationPage(new ContentPage { Content = new Label { Text = "Success" } }); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla42277.cs b/src/Controls/tests/TestCases/Issues/Bugzilla42277.cs new file mode 100644 index 000000000000..72cd5f7f6c1d --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla42277.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 42277, "DataTemplate System.InvalidCastException crash in 2.3.1-pre1")] + public class Bugzilla42277 : TestContentPage + { + const string Success1 = "Success1"; + const string Success2 = "Success2"; + const string Success3 = "GroupedSuccess3"; + const string Success4 = "GroupedSuccess4"; + const string Success5 = "GroupedSuccess5"; + const string Success6 = "GroupedSuccess6"; + + class MyDataTemplateSelector : DataTemplateSelector + { + DataTemplate _1Template; + DataTemplate _2Template; + + DataTemplate _3Template; + DataTemplate _4Template; + DataTemplate _5Template; + DataTemplate _6Template; + + public MyDataTemplateSelector() + { + _1Template = new DataTemplate(() => + { + return new TextCell { Text = Success1 }; + }); + + _2Template = new DataTemplate(() => + { + return new TextCell { Text = Success2 }; + }); + + _3Template = new DataTemplate(() => + { + return new TextCell { Text = Success3 }; + }); + + _4Template = new DataTemplate(() => + { + return new TextCell { Text = Success4 }; + }); + + _5Template = new DataTemplate(() => + { + return new TextCell { Text = Success5 }; + }); + + _6Template = new DataTemplate(() => + { + return new TextCell { Text = Success6 }; + }); + } + + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + int number = (int)item; + switch (number) + { + default: + case 0: + return _1Template; + case 1: + return _2Template; + case 2: + return _3Template; + case 3: + return _4Template; + case 4: + return _5Template; + case 5: + return _6Template; + } + } + } + + protected override void Init() + { + //test non-grouped DTS + ListView listView = new ListView(ListViewCachingStrategy.RecycleElement) + { + ItemsSource = Enumerable.Range(0, 2), + ItemTemplate = new MyDataTemplateSelector() + }; + + //test grouped DTS + ListView groupedListView = new ListView(ListViewCachingStrategy.RecycleElement) + { + ItemsSource = new List> { Enumerable.Range(2, 2).ToList(), Enumerable.Range(4, 2).ToList() }, + IsGroupingEnabled = true, + ItemTemplate = new MyDataTemplateSelector() + }; + + Content = new StackLayout { Children = { listView, groupedListView } }; + + //test collection changed + listView.ItemsSource = Enumerable.Range(0, 2); + groupedListView.ItemsSource = new List> { Enumerable.Range(2, 2).ToList(), Enumerable.Range(4, 2).ToList() }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla42956.cs b/src/Controls/tests/TestCases/Issues/Bugzilla42956.cs new file mode 100644 index 000000000000..9ebff2e41d1f --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla42956.cs @@ -0,0 +1,129 @@ +using System; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 42956, "ListView with DataTemplateSelector can have only 17 Templates, even with CachingStrategy=RetainElement", PlatformAffected.Android)] + public class Bugzilla42956 : TestContentPage + { + const string Success = "Success"; + + class MyDataTemplateSelector : DataTemplateSelector + { + readonly DataTemplate one; + readonly DataTemplate two; + readonly DataTemplate three; + readonly DataTemplate four; + readonly DataTemplate five; + readonly DataTemplate six; + readonly DataTemplate seven; + readonly DataTemplate eight; + readonly DataTemplate nine; + readonly DataTemplate ten; + readonly DataTemplate eleven; + readonly DataTemplate twelve; + readonly DataTemplate thirteen; + readonly DataTemplate fourteen; + readonly DataTemplate fifteen; + readonly DataTemplate sixteen; + readonly DataTemplate seventeen; + readonly DataTemplate eighteen; + readonly DataTemplate nineteen; + readonly DataTemplate twenty; + + public MyDataTemplateSelector() + { + one = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the one!" } }); + two = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the two!" } }); + three = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the three!" } }); + four = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the four!" } }); + five = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the five!" } }); + six = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the six!" } }); + seven = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the seven!" } }); + eight = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the eight!" } }); + nine = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the nine!" } }); + ten = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the ten!" } }); + eleven = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the eleven!" } }); + twelve = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the twelve!" } }); + thirteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the thirteen!" } }); + fourteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the fourteen!" } }); + fifteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the fifteen!" } }); + sixteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the sixteen!" } }); + seventeen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the seventeen!" } }); + eighteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the eighteen!" } }); + nineteen = new DataTemplate(() => new ViewCell { View = new Label { Text = "I am the nineteen! Is this how I should be databinding? Whatev." } }); + twenty = new DataTemplate(() => new ViewCell { View = new Label { Text = Success } }); + } + + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + var val = (int)item; + + switch (val) + { + case 1: + return one; + case 2: + return two; + case 3: + return three; + case 4: + return four; + case 5: + return five; + case 6: + return six; + case 7: + return seven; //not six + case 8: + return eight; + case 9: + return nine; + case 10: + return ten; + case 11: + return eleven; + case 12: + return twelve; + case 13: + return thirteen; + case 14: + return fourteen; + case 15: + return fifteen; + case 16: + return sixteen; + case 17: + return seventeen; + case 18: + return eighteen; + case 19: + default: + return nineteen; + case 75: + return twenty; + } + } + } + + protected override void Init() + { + var dts = new MyDataTemplateSelector(); + var listView = new ListView + { + ItemsSource = Enumerable.Range(0, 100), + ItemTemplate = dts + }; + + var layout = new StackLayout { Children = { listView } }; + + Content = layout; + + listView.ScrollTo(75, ScrollToPosition.MakeVisible, true); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla43519.cs b/src/Controls/tests/TestCases/Issues/Bugzilla43519.cs new file mode 100644 index 000000000000..8454b21fa5bf --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla43519.cs @@ -0,0 +1,71 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 43519, "[UWP] FlyoutPage ArgumentException when nested in a TabbedPage and returning from modal page" + , PlatformAffected.UWP)] + public class Bugzilla43519 : TestTabbedPage + { + const string Pop = "PopModal"; + + const string Push = "PushModal"; + + const string Page2 = "Page 2"; + + protected override void Init() + { + var modalPage = new ContentPage + { + Title = "ModalPage", + Content = new StackLayout + { + Children = + { + new Button + { + Command = new Command(() => Navigation.PopModalAsync()), + Text = "Pop modal page -- should not crash on UWP", + AutomationId = Pop + } + } + } + }; + + var mdp = new FlyoutPage + { + Title = "Page 1", + Flyout = new ContentPage + { + Title = "Flyout", + Content = new StackLayout() + }, + Detail = new ContentPage + { + Title = "Detail", + Content = new StackLayout() + } + }; + + Children.Add(mdp); + Children.Add(new ContentPage + { + Title = Page2, + Content = new StackLayout + { + Children = + { + new Button + { + Command = new Command(() => Navigation.PushModalAsync(modalPage)), + Text = "Click to display modal", + AutomationId = Push + } + } + } + }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla44096.cs b/src/Controls/tests/TestCases/Issues/Bugzilla44096.cs new file mode 100644 index 000000000000..750f34e235f7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla44096.cs @@ -0,0 +1,140 @@ +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 44096, "Grid, StackLayout, and ContentView still participate in hit testing on " + + "Android after IsEnabled is set to false", PlatformAffected.Android)] + public class Bugzilla44096 : TestContentPage + { + bool _flag; + const string Child = "Child"; + const string Original = "Original"; + const string ToggleColor = "color"; + const string ToggleIsEnabled = "disabled"; + + const string StackLayout = "stackLayout"; + const string ContentView = "contentView"; + const string Grid = "grid"; + const string RelativeLayout = "relativeLayout"; + + protected override void Init() + { + var result = new Label + { + Text = Original + }; + + var grid = new Grid + { + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = Grid + }; + AddTapGesture(result, grid); + + var contentView = new ContentView + { + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = ContentView + }; + AddTapGesture(result, contentView); + + var stackLayout = new StackLayout + { + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = StackLayout + }; + AddTapGesture(result, stackLayout); + + var relativeLayout = new Compatibility.RelativeLayout + { + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = RelativeLayout + }; + AddTapGesture(result, relativeLayout); + + var color = new Button + { + Text = "Toggle colors", + Command = new Command(() => + { + if (!_flag) + { + grid.BackgroundColor = Colors.Red; + contentView.BackgroundColor = Colors.Blue; + stackLayout.BackgroundColor = Colors.Yellow; + relativeLayout.BackgroundColor = Colors.Green; + } + else + { + grid.BackgroundColor = null; + contentView.BackgroundColor = null; + stackLayout.BackgroundColor = null; + relativeLayout.BackgroundColor = null; + } + + _flag = !_flag; + }), + AutomationId = ToggleColor + }; + + var disabled = new Button + { + Text = "Toggle IsEnabled", + Command = new Command(() => + { + grid.IsEnabled = false; + contentView.IsEnabled = false; + stackLayout.IsEnabled = false; + relativeLayout.IsEnabled = false; + + result.Text = Original; + }), + AutomationId = ToggleIsEnabled + }; + + var parent = new StackLayout + { + Spacing = 10, + Orientation = StackOrientation.Vertical, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + Children = + { + color, + disabled, + result, + grid, + contentView, + stackLayout, + relativeLayout + } + }; + + Content = parent; + } + + void AddTapGesture(Label result, View view) + { + var tapGestureRecognizer = new TapGestureRecognizer + { + Command = new Command(() => + { + result.Text = Child; + }) + }; + view.GestureRecognizers.Add(tapGestureRecognizer); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla44176.cs b/src/Controls/tests/TestCases/Issues/Bugzilla44176.cs new file mode 100644 index 000000000000..bd23cde8bdba --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla44176.cs @@ -0,0 +1,113 @@ +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 44176, "InputTransparent fails if BackgroundColor not explicitly set on Android", PlatformAffected.Android)] + public class Bugzilla44176 : TestContentPage + { + bool _flag; + + protected override void Init() + { + var result = new Label(); + + var grid = new Grid + { + InputTransparent = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "grid" + }; + AddTapGesture(result, grid); + + var contentView = new ContentView + { + InputTransparent = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "contentView" + }; + AddTapGesture(result, contentView); + + var stackLayout = new StackLayout + { + InputTransparent = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "stackLayout" + }; + AddTapGesture(result, stackLayout); + + var color = new Button + { + Text = "Toggle colors", + Command = new Command(() => + { + if (!_flag) + { + grid.BackgroundColor = Colors.Red; + contentView.BackgroundColor = Colors.Blue; + stackLayout.BackgroundColor = Colors.Yellow; + } + else + { + grid.BackgroundColor = null; + contentView.BackgroundColor = null; + stackLayout.BackgroundColor = null; + } + + _flag = !_flag; + }), + AutomationId = "color" + }; + + var nonTransparent = new Button + { + Text = "Non-transparent", + Command = new Command(() => + { + grid.InputTransparent = false; + contentView.InputTransparent = false; + stackLayout.InputTransparent = false; + }), + AutomationId = "nontransparent" + }; + + var parent = new StackLayout + { + Spacing = 10, + Orientation = StackOrientation.Vertical, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + Children = + { + color, + nonTransparent, + result, + grid, + contentView, + stackLayout + } + }; + AddTapGesture(result, parent, true); + + Content = parent; + } + + void AddTapGesture(Label result, View view, bool isParent = false) + { + var tapGestureRecognizer = new TapGestureRecognizer + { + Command = new Command(() => + { + result.Text = !isParent ? "Child" : "Parent"; + }) + }; + view.GestureRecognizers.Add(tapGestureRecognizer); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla44476.cs b/src/Controls/tests/TestCases/Issues/Bugzilla44476.cs new file mode 100644 index 000000000000..0ef49fbfadc6 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla44476.cs @@ -0,0 +1,52 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 44476, "[Android] Unwanted margin at top of details page when nested in a NavigationPage")] + public class Bugzilla44476 : TestNavigationPage + { + protected override void Init() + { + BackgroundColor = Colors.Maroon; + PushAsync(new FlyoutPage + { + Title = "Bugzilla Issue 44476", + Flyout = new ContentPage + { + Title = "Flyout", + Content = new StackLayout + { + Children = + { + new Label { Text = "Flyout" } + } + } + }, + Detail = new ContentPage + { + Title = "Detail", + Content = new StackLayout + { + VerticalOptions = LayoutOptions.FillAndExpand, + Children = + { + new Label { Text = "Detail Page" }, + new StackLayout + { + VerticalOptions = LayoutOptions.EndAndExpand, + Children = + { + new Label { Text = "This should be visible." } + } + } + } + } + }, + }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla45702.cs b/src/Controls/tests/TestCases/Issues/Bugzilla45702.cs new file mode 100644 index 000000000000..69a1769434c9 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla45702.cs @@ -0,0 +1,39 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 45702, "Disabling back press on modal page causes app to crash", PlatformAffected.Android)] + public class Bugzilla45702 : TestNavigationPage + { + protected override void Init() + { + Navigation.PushAsync(new NavigationPage(new FlyoutPage() { Flyout = new ContentPage() { Title = "Flyout" }, Detail = new DetailPage45702() })); + + MessagingCenter.Subscribe(this, "switch", SwitchControl); + } + + void SwitchControl(object sender) + { + Application.Current.MainPage = new NavigationPage(new ContentPage { Content = new Label { Text = "Success" } }); + } + + [Preserve(AllMembers = true)] + class DetailPage45702 : ContentPage + { + public DetailPage45702() + { + var button = new Button { Text = "Click me" }; + button.Clicked += Button_Clicked; + Content = button; + } + + void Button_Clicked(object sender, System.EventArgs e) + { + MessagingCenter.Send(this, "switch"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla45722.cs b/src/Controls/tests/TestCases/Issues/Bugzilla45722.cs new file mode 100644 index 000000000000..d6daec211fe7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla45722.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 45722, "Memory leak in Xamarin Forms ListView", PlatformAffected.UWP)] + public class Bugzilla45722 : TestContentPage + { + const string Success = "Success"; + const string Running = "Running..."; + const string Update = "Update List"; + const string Collect = "GC"; + + const int ItemCount = 10; + + Label _currentLabelCount; + Label _statusLabel; + + protected override void Init() + { + _currentLabelCount = new Label(); + _statusLabel = new Label { Text = Running }; + + MessagingCenter.Subscribe<_45722Label>(this, _45722Label.CountMessage, sender => + { + Device.BeginInvokeOnMainThread(() => + { + _currentLabelCount.Text = _45722Label.Count.ToString(); + _statusLabel.Text = _45722Label.Count - ItemCount <= 0 ? Success : Running; + }); + }); + + var lv = new ListView(ListViewCachingStrategy.RetainElement); + + var items = new ObservableCollection<_45722Model>(); + + foreach (var item in CreateItems()) + { + items.Add(item); + } + + var dt = new DataTemplate(() => + { + var layout = new Grid(); + + var label = new _45722Label(); + label.SetBinding(Label.TextProperty, new Binding("Text")); + + var bt = new Button { Text = "Go" }; + bt.SetBinding(Button.CommandProperty, new Binding("Command")); + + var en = new Entry { Text = "entry" }; + + layout.Children.Add(bt); + layout.Children.Add(en); + layout.Children.Add(label); + + Grid.SetRow(bt, 1); + Grid.SetRow(en, 2); + + return new ViewCell { View = layout }; + }); + + lv.ItemsSource = items; + lv.ItemTemplate = dt; + + var button = new Button { Text = Update }; + button.Clicked += (sender, args) => + { + items.Clear(); + foreach (var item in CreateItems()) + { + items.Add(item); + } + }; + + var collect = new Button() { Text = Collect }; + collect.Clicked += (sender, args) => + { + GarbageCollectionHelper.Collect(); + }; + + Title = "Bugzilla 45722"; + Content = new StackLayout + { + Padding = new Thickness(0, 20, 0, 0), + Children = { _currentLabelCount, _statusLabel, button, collect, lv } + }; + } + + [Preserve(AllMembers = true)] + public class _45722Model : INotifyPropertyChanged + { + string _text; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged1([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public _45722Model(string text) + { + _text = text; + Command = new Command(() => Debug.WriteLine($">>>>> _45722Model Command Running")); + } + + public string Text + { + get { return _text; } + set + { + _text = value; + OnPropertyChanged1(); + } + } + + public Command Command { get; } + } + + static IEnumerable<_45722Model> CreateItems() + { + var r = new Random(DateTime.Now.Millisecond); + for (int n = 0; n < ItemCount; n++) + { + yield return new _45722Model(r.NextDouble().ToString(CultureInfo.InvariantCulture)); + } + } + + protected override void OnDisappearing() + { + MessagingCenter.Unsubscribe<_45722Label>(this, _45722Label.CountMessage); + base.OnDisappearing(); + } + } + + [Preserve(AllMembers = true)] + public class _45722Label : Label + { + public static int Count; + public const string CountMessage = "45722Count"; + + public _45722Label() + { + Interlocked.Increment(ref Count); + MessagingCenter.Send(this, CountMessage); + } + + ~_45722Label() + { + Interlocked.Decrement(ref Count); + MessagingCenter.Send(this, CountMessage); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla46458.cs b/src/Controls/tests/TestCases/Issues/Bugzilla46458.cs new file mode 100644 index 000000000000..d64c01c816f0 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla46458.cs @@ -0,0 +1,90 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 46458, "Grid.IsEnabled property is not working", PlatformAffected.Android)] + public class Bugzilla46458 : TestContentPage + { + protected override void Init() + { + var parentGrid = new Grid + { + BackgroundColor = Colors.Yellow + }; + parentGrid.RowDefinitions.Add(new RowDefinition()); + parentGrid.RowDefinitions.Add(new RowDefinition()); + + var grid = new Grid + { + IsEnabled = false, + BackgroundColor = Colors.Red + }; + + grid.RowDefinitions.Add(new RowDefinition()); + grid.RowDefinitions.Add(new RowDefinition()); + grid.RowDefinitions.Add(new RowDefinition()); + + var label = new Label + { + HorizontalOptions = LayoutOptions.Center, + Text = "Success" + }; + Grid.SetRow(label, 0); + grid.Children.Add(label); + + var entry = new Entry + { + HorizontalOptions = LayoutOptions.Center, + HeightRequest = 50, + WidthRequest = 250, + Placeholder = "Placeholder", + AutomationId = "entry" + }; + Grid.SetRow(entry, 1); + entry.Focused += (sender, args) => { label.Text = "Fail"; }; + grid.Children.Add(entry); + + var button = new Button + { + WidthRequest = 250, + HeightRequest = 50, + BackgroundColor = Colors.Black, + TextColor = Colors.White, + Text = "Click", + HorizontalOptions = LayoutOptions.Center, + Command = new Command(() => { label.Text = "Fail"; }), + AutomationId = "button" + }; + Grid.SetRow(button, 2); + grid.Children.Add(button); + + parentGrid.Children.Add(grid); + Grid.SetRow(grid, 1); + + var button1 = new Button + { + WidthRequest = 250, + HeightRequest = 50, + BackgroundColor = Colors.Black, + TextColor = Colors.White, + Text = "Test transparency", + HorizontalOptions = LayoutOptions.Center, + AutomationId = "button1" + }; + button1.Command = new Command((sender) => + { + grid.IsEnabled = true; + grid.InputTransparent = true; + button1.Text = "Clicked"; + }); + Grid.SetRow(button1, 0); + parentGrid.Children.Add(button1); + + Content = parentGrid; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla51238.cs b/src/Controls/tests/TestCases/Issues/Bugzilla51238.cs new file mode 100644 index 000000000000..cb7c14da4cc7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla51238.cs @@ -0,0 +1,53 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 51238, + "Transparent Grid causes Java.Lang.IllegalStateException: Unable to create layer for Platform_DefaultRenderer", + PlatformAffected.Android)] + public class Bugzilla51238 : TestContentPage + { + protected override void Init() + { + var grid = new Grid(); + grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + grid.RowDefinitions.Add(new RowDefinition { Height = 50 }); + + var transparentLayer = new Grid(); + transparentLayer.IsVisible = false; + transparentLayer.BackgroundColor = Colors.Lime; + transparentLayer.Opacity = 0.5; + + var label = new Label + { + Text = "Foo", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + + Grid.SetRow(label, 0); + Grid.SetRow(transparentLayer, 0); + + var button = new Button + { + Text = "Tap Me!", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + + Grid.SetRow(button, 1); + + button.Clicked += (sender, args) => { transparentLayer.IsVisible = !transparentLayer.IsVisible; }; + + grid.Children.Add(label); + grid.Children.Add(transparentLayer); + grid.Children.Add(button); + + Content = grid; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla51503.cs b/src/Controls/tests/TestCases/Issues/Bugzilla51503.cs new file mode 100644 index 000000000000..96862bf58523 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla51503.cs @@ -0,0 +1,58 @@ +using System; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 51503, "NullReferenceException on VisualElement Finalize", PlatformAffected.All)] + public class Bugzilla51503 : TestNavigationPage + { + protected override void Init() + { + PushAsync(new _51503RootPage()); + } + + [Preserve(AllMembers = true)] + class _51503RootPage : ContentPage + { + public _51503RootPage() + { + Button button = new Button + { + AutomationId = "Button", + Text = "Open" + }; + + button.Clicked += Button_Clicked; + + Content = button; + } + + async void Button_Clicked(object sender, EventArgs e) + { + GarbageCollectionHelper.Collect(); + + await Navigation.PushAsync(new ChildPage()); + } + } + + [Preserve(AllMembers = true)] + class ChildPage : ContentPage + { + public ChildPage() + { + Content = new Label + { + AutomationId = "VisualElement", + Text = "Navigate 3 times to this page", + Triggers = + { + new EventTrigger() + } + }; + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla51505.cs b/src/Controls/tests/TestCases/Issues/Bugzilla51505.cs new file mode 100644 index 000000000000..4be800c7eb45 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla51505.cs @@ -0,0 +1,37 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 51505, "ObjectDisposedException On Effect detachment.", PlatformAffected.Android)] + public class Bugzilla51505 : TestContentPage + { + const string ButtonId = "button"; + + protected override void Init() + { + var effect = Effect.Resolve($"{Issues.Effects.ResolutionGroupName}.BorderEffect"); + + var button = new Button { Text = "Click me", AutomationId = ButtonId }; + button.Clicked += async (sender, e) => + { + await Navigation.PopAsync(); + }; + button.Effects.Add(effect); + + Content = new StackLayout + { + Children = + { + new Label + { + Text = "The following Button has an Effect applied to it that should attempt to access the Control when it is Detached. When you click the Button, this page should be popped. If the app crashes, this test has failed." + }, + button + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla52533.cs b/src/Controls/tests/TestCases/Issues/Bugzilla52533.cs new file mode 100644 index 000000000000..b670a7786c97 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla52533.cs @@ -0,0 +1,46 @@ +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 52533, "System.ArgumentException: NaN is not a valid value for width", PlatformAffected.iOS)] + public class Bugzilla52533 : TestContentPage + { + const string LabelId = "label"; + + protected override void Init() + { + Content = new ListView { ItemTemplate = new DataTemplate(typeof(GridViewCell)), ItemsSource = Enumerable.Range(0, 10) }; + } + + [Preserve(AllMembers = true)] + class GridViewCell : ViewCell + { + + public GridViewCell() + { + var grid = new Grid + { + // Multiple rows + RowDefinitions = { + new RowDefinition { Height = new GridLength(20, GridUnitType.Absolute) }, + new RowDefinition { Height = new GridLength(150, GridUnitType.Absolute) } + }, + // Dynamic width + ColumnDefinitions = { + new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } + } + }; + + // Infinitely wide + Label + var horStack = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { new Label { Text = "If this does not crash, this test has passed.", AutomationId = LabelId } } }; + grid.Children.Add(horStack, 0, 0); + + View = grid; + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla53179.cs b/src/Controls/tests/TestCases/Issues/Bugzilla53179.cs new file mode 100644 index 000000000000..81d793cbab76 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla53179.cs @@ -0,0 +1,67 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 53179, + "PopAsync crashing after RemovePage when support packages are updated to 25.1.1", PlatformAffected.Android)] + public class Bugzilla53179 : TestNavigationPage + { + + class TestPage : ContentPage + { + Button nextBtn, rmBtn, popBtn; + + public TestPage(int index) + { + nextBtn = new Button { Text = "Next Page" }; + rmBtn = new Button { Text = "Remove previous pages" }; + popBtn = new Button { Text = "Back" }; + + nextBtn.Clicked += async (sender, e) => await Navigation.PushAsync(new TestPage(index + 1)); + rmBtn.Clicked += (sender, e) => + { + var stackSize = Navigation.NavigationStack.Count; + Navigation.RemovePage(Navigation.NavigationStack[stackSize - 2]); + + stackSize = Navigation.NavigationStack.Count; + Navigation.RemovePage(Navigation.NavigationStack[stackSize - 2]); + + popBtn.IsVisible = true; + rmBtn.IsVisible = false; + }; + popBtn.Clicked += async (sender, e) => await Navigation.PopAsync(); + + switch (index) + { + case 4: + nextBtn.IsVisible = false; + popBtn.IsVisible = false; + break; + default: + rmBtn.IsVisible = false; + popBtn.IsVisible = false; + break; + } + + Content = new StackLayout + { + Children = { + new Label { Text = $"This is page {index}"}, + nextBtn, + rmBtn, + popBtn + } + }; + } + } + + + protected override void Init() + { + PushAsync(new TestPage(1)); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla53445.cs b/src/Controls/tests/TestCases/Issues/Bugzilla53445.cs new file mode 100644 index 000000000000..de5ee9986c86 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla53445.cs @@ -0,0 +1,78 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 53445, "Setting Grid.IsEnabled to false does not disable child controls", PlatformAffected.All)] + public class Bugzilla53445 : TestContentPage + { + protected override void Init() + { + var layout = new StackLayout { VerticalOptions = LayoutOptions.Fill, Spacing = 20 }; + + var status = new Label { Text = "Success" }; + + var instructions = new Label { Text = "Disable all of the layouts by clicking the Toggle button. Then click the buttons inside each layout. If the status changes from Success to Fail, this test has failed." }; + + var grid = new Grid + { + BackgroundColor = Colors.Blue, + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "grid" + }; + + var gridButton = new Button { AutomationId = "gridbutton", Text = "Test", WidthRequest = 50 }; + grid.Children.Add(gridButton); + gridButton.Clicked += (sender, args) => status.Text = "Fail"; + + var contentView = new ContentView + { + BackgroundColor = Colors.Green, + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "contentView" + }; + + var contentViewButton = new Button { AutomationId = "contentviewbutton", Text = "Test", WidthRequest = 50 }; + contentView.Content = contentViewButton; + contentViewButton.Clicked += (sender, args) => status.Text = "Fail"; + + var stackLayout = new StackLayout + { + BackgroundColor = Colors.Orange, + IsEnabled = true, + WidthRequest = 250, + HeightRequest = 50, + AutomationId = "stackLayout" + }; + + var stackLayoutButton = new Button { AutomationId = "stacklayoutbutton", Text = "Test", WidthRequest = 50 }; + stackLayout.Children.Add(stackLayoutButton); + stackLayoutButton.Clicked += (sender, args) => status.Text = "Fail"; + + var toggleButton = new Button { AutomationId = "toggle", Text = $"Toggle IsEnabled (currently {grid.IsEnabled})" }; + toggleButton.Clicked += (sender, args) => + { + grid.IsEnabled = !grid.IsEnabled; + contentView.IsEnabled = !contentView.IsEnabled; + stackLayout.IsEnabled = !stackLayout.IsEnabled; + toggleButton.Text = $"Toggle IsEnabled (currently {grid.IsEnabled})"; + }; + + layout.Children.Add(instructions); + layout.Children.Add(status); + layout.Children.Add(toggleButton); + layout.Children.Add(grid); + layout.Children.Add(contentView); + layout.Children.Add(stackLayout); + + Content = layout; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla53834.cs b/src/Controls/tests/TestCases/Issues/Bugzilla53834.cs new file mode 100644 index 000000000000..bdcf6782887f --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla53834.cs @@ -0,0 +1,81 @@ +using System.Collections.ObjectModel; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 53834, "incorrect row heights on ios when using groupheadertemplate in Xamarin.Forms 2.3.4.214-pre5", PlatformAffected.iOS)] + public class Bugzilla53834 : TestContentPage + { + const string Instructions = ""; + ObservableCollection grouped { get; set; } + ListView lstView; + + class MyViewCell : ViewCell + { + public MyViewCell() + { + var label = new Label { HeightRequest = 66, VerticalOptions = LayoutOptions.Start }; + label.SetBinding(Label.TextProperty, "."); + View = new StackLayout { Padding = 10, Children = { label } }; + } + } + + class MyHeaderViewCell : ViewCell + { + public MyHeaderViewCell() + { + Height = 25; + var label = new Label { VerticalOptions = LayoutOptions.Center }; + label.SetBinding(Label.TextProperty, nameof(GroupedItem.LongName)); + View = label; + } + } + + class GroupedItem : ObservableCollection + { + public string LongName { get; set; } + public string ShortName { get; set; } + } + + protected override void Init() + { + var label = new Label { Text = Instructions, }; + grouped = new ObservableCollection(); + lstView = new ListView() + { + IsGroupingEnabled = true, + HasUnevenRows = true, + ItemTemplate = new DataTemplate(typeof(MyViewCell)), + GroupHeaderTemplate = new DataTemplate(typeof(MyHeaderViewCell)), + ItemsSource = grouped, + AutomationId = "TestReady" + }; + + var grp1 = new GroupedItem() { LongName = "Group 1", ShortName = "1" }; + var grp2 = new GroupedItem() { LongName = "Group 2", ShortName = "2" }; + + for (int i = 1; i < 4; i++) + { + grp1.Add($"I am a short text #{i}"); + grp1.Add($"I am a long text that should cause the line to wrap, and I should not be cut off or overlapping in any way. #{i}"); + grp2.Add($"I am a short text #{i}"); + grp2.Add($"I am a long text that should cause the line to wrap, and I should not be cut off or overlapping in any way. #{i}"); + } + + grouped.Add(grp1); + grouped.Add(grp2); + + Content = new StackLayout + { + Children = { + label, + lstView + } + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla55365.cs b/src/Controls/tests/TestCases/Issues/Bugzilla55365.cs new file mode 100644 index 000000000000..396d43d71462 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla55365.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 55365, "~VisualElement crashes with System.Runtime.InteropServices.COMException", PlatformAffected.UWP)] + public class Bugzilla55365 : TestContentPage + { + readonly StackLayout _itemsPanel = new StackLayout(); + readonly DataTemplate _itemTemplate = new DataTemplate(CreateBoxView); + readonly StackLayout _layout = new StackLayout(); + + protected override void Init() + { + var viewModel = new ObservableCollection<_55365Item> + { + new _55365Item { Subject = 65 } + }; + + viewModel.CollectionChanged += OnCollectionChanged; + + _itemsPanel.BindingContext = viewModel; + + foreach (_55365Item item in viewModel) + { + _itemTemplate.SetValue(BindingContextProperty, item); + var view = (View)_itemTemplate.CreateContent(); + _itemsPanel.Children.Add(view); + } + + var clearButton = new Button { Text = "Clear", Command = new Command(o => viewModel.Clear()) }; + _layout.Children.Add(clearButton); + + var collectButton = new Button + { + Text = "Garbage", + Command = new Command(o => + { + GarbageCollectionHelper.Collect(); + _layout.Children.Add(new Label { Text = "Success" }); + }) + }; + _layout.Children.Add(collectButton); + _layout.Children.Add(_itemsPanel); + + Content = _layout; + } + + static object CreateBoxView() + { + var boxView1 = new BoxView { HeightRequest = 100, Color = new Color(0.55f, 0.23f, 0.147f) }; + var setter1 = new Setter { Property = BoxView.ColorProperty, Value = "#FF2879DD" }; + var trigger1 = new DataTrigger(typeof(BoxView)) { Binding = new Binding("Subject"), Value = 65 }; + trigger1.Setters.Add(setter1); + boxView1.Triggers.Add(trigger1); + return boxView1; + } + + void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action == NotifyCollectionChangedAction.Reset) + { + // reset the list + _itemsPanel.Children.Clear(); + } + } + + [Preserve(AllMembers = true)] + public class _55365Item + { + public int Subject { get; set; } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla55745.cs b/src/Controls/tests/TestCases/Issues/Bugzilla55745.cs new file mode 100644 index 000000000000..404cf5438b2c --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla55745.cs @@ -0,0 +1,154 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 55745, "[iOS] NRE in ListView with HasUnevenRows=true after changing content and rebinding", PlatformAffected.iOS)] + public class Bugzilla55745 : TestContentPage + { + const string ButtonId = "button"; + ViewModel vm; + + protected override void Init() + { + vm = new ViewModel(); + BindingContext = vm; + + var listView = new ListView + { + HasUnevenRows = true, + ItemTemplate = new DataTemplate(() => + { + var label1 = new Label(); + label1.SetBinding(Label.TextProperty, nameof(DataViewModel.TextOne)); + var label2 = new Label(); + label2.SetBinding(Label.TextProperty, nameof(DataViewModel.TextTwo)); + return new ViewCell { View = new StackLayout { Children = { label1, label2 } } }; + }) + }; + + listView.SetBinding(ListView.ItemsSourceProperty, nameof(vm.MyCollection)); + + var button = new Button { Text = "Tap me twice. The app should not crash.", AutomationId = ButtonId }; + button.Clicked += Button_Clicked; + + Content = new StackLayout { Children = { button, listView } }; + } + + void Button_Clicked(object sender, System.EventArgs e) + { + vm.ToggleContent(); + } + + [Preserve(AllMembers = true)] + class DataViewModel : INotifyPropertyChanged + { + string mTextOne; + + string mTextTwo; + + public event PropertyChangedEventHandler PropertyChanged; + + public string TextOne + { + get { return mTextOne; } + set + { + mTextOne = value; + OnPropertyChanged(nameof(TextOne)); + } + } + + public string TextTwo + { + get { return mTextTwo; } + set + { + mTextTwo = value; + OnPropertyChanged(nameof(TextTwo)); + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + + [Preserve(AllMembers = true)] + class ViewModel : INotifyPropertyChanged + { + public List myList = new List() + { + new DataViewModel() { TextOne = "Super", TextTwo = "Juuu"}, + new DataViewModel() { TextOne = "Michael", TextTwo = "Maier"}, + new DataViewModel() { TextOne = "House", TextTwo = "Cat"}, + new DataViewModel() { TextOne = "Flower", TextTwo = "Rock"}, + new DataViewModel() { TextOne = "Job", TextTwo = "Dog"}, + new DataViewModel() { TextOne = "Super", TextTwo = "Juuu"}, + new DataViewModel() { TextOne = "Michael", TextTwo = "Maier"}, + new DataViewModel() { TextOne = "House", TextTwo = "Cat"}, + new DataViewModel() { TextOne = "Flower", TextTwo = "Rock"}, + new DataViewModel() { TextOne = "Job", TextTwo = "Dog"} + }; + + ObservableCollection mMyCollection; + + DataViewModel mSelectedData; + + public ViewModel() + { + MyCollection = new ObservableCollection(myList); + } + + public event PropertyChangedEventHandler PropertyChanged; + + public ObservableCollection MyCollection + { + get + { + return mMyCollection; + } + set + { + mMyCollection = value; + OnPropertyChanged(nameof(MyCollection)); + } + } + + public DataViewModel SelectedData + { + get { return mSelectedData; } + set + { + mSelectedData = value; + OnPropertyChanged(nameof(SelectedData)); + } + } + + public void ToggleContent() + { + if (MyCollection.Count < 3) + { + MyCollection.Clear(); + MyCollection = new ObservableCollection(myList); + } + else + { + MyCollection.Clear(); + MyCollection.Add(myList[2]); + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla55912.cs b/src/Controls/tests/TestCases/Issues/Bugzilla55912.cs new file mode 100644 index 000000000000..e496319dd9a9 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla55912.cs @@ -0,0 +1,75 @@ +using System; +using System.Diagnostics; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 55912, "Tap event not always propagated to containing Grid/StackLayout", + PlatformAffected.Android)] + public class Bugzilla55912 : TestContentPage + { + const string Success = "Success"; + const string GridLabelId = "GridLabel"; + const string StackLabelId = "StackLabel"; + + protected override void Init() + { + var layout = new Grid(); + + layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + + var testGrid = new Grid { BackgroundColor = Colors.Red, AutomationId = "testgrid" }; + var gridLabel = new Label + { + AutomationId = GridLabelId, + Text = "This is a Grid with a TapGesture", + FontSize = 24, + BackgroundColor = Colors.Green + }; + Grid.SetRow(testGrid, 1); + testGrid.Children.Add(gridLabel); + + var testStack = new StackLayout { BackgroundColor = null, AutomationId = "teststack" }; + var stackLabel = new Label + { + AutomationId = StackLabelId, + Text = "This StackLayout also has a TapGesture", + FontSize = 24, + BackgroundColor = Colors.Green + }; + Grid.SetRow(testStack, 2); + testStack.Children.Add(stackLabel); + + layout.Children.Add(testGrid); + layout.Children.Add(testStack); + + Content = layout; + + testGrid.GestureRecognizers.Add(new TapGestureRecognizer + { + NumberOfTapsRequired = 1, + Command = new Command(() => + { + Debug.WriteLine($"***** TestGrid Tapped: {DateTime.Now} *****"); + layout.Children.Add(new Label { AutomationId = Success, Text = Success }); + }) + }); + + testStack.GestureRecognizers.Add(new TapGestureRecognizer + { + NumberOfTapsRequired = 1, + Command = new Command(() => + { + Debug.WriteLine($"***** TestStack Tapped: {DateTime.Now} *****"); + layout.Children.Add(new Label { AutomationId = Success, Text = Success }); + }) + }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla56298.cs b/src/Controls/tests/TestCases/Issues/Bugzilla56298.cs new file mode 100644 index 000000000000..fba44143c187 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla56298.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.PlatformConfiguration; +using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 56298, "Changing ListViews HasUnevenRows at runtime on iOS has no effect", PlatformAffected.iOS)] + public class Bugzilla56298 : TestContentPage // or TestFlyoutPage, etc ... + { + + ListView list; + Button button; + StackLayout layoutRoot; + + ObservableCollection groups; + public static int Count = 0; + + protected override void Init() + { + On().SetUseSafeArea(true); + list = new ListView(); + + var template = new DataTemplate(typeof(UnevenViewCell)); + //template.SetBinding(TextCell.TextProperty, "FullName"); + //template.SetBinding(TextCell.DetailProperty, "Address"); + list.ItemTemplate = template; + + groups = new ObservableCollection(); + list.ItemsSource = groups; + list.GroupDisplayBinding = new Binding(nameof(Group.Key)); + list.GroupShortNameBinding = new Binding(nameof(Group.Key)); + list.IsGroupingEnabled = true; + + button = new Button { Text = "Add new data", AutomationId = "btnAdd" }; + button.Clicked += Button_Clicked; + + var button1 = new Button { Text = "Toggle Uneven rows", AutomationId = "btnToggle" }; + button1.Clicked += Button_Clicked1; + + + layoutRoot = new StackLayout(); + layoutRoot.Children.Add(list); + layoutRoot.Children.Add(button); + layoutRoot.Children.Add(button1); + + this.Content = layoutRoot; + } + + void Button_Clicked(object sender, EventArgs e) + { + + var group = new Group() + { + Key = "A" + }; + for (int i = 0; i < 59; i++) + { + group.Add(new Person1 + { + FullName = "Andrew", + Address = "404 Somewhere" + }); + } + + groups.Add(group); + } + + private void Button_Clicked1(object sender, EventArgs e) + { + list.HasUnevenRows = !list.HasUnevenRows; + } + + [Preserve(AllMembers = true)] + class UnevenViewCell : ViewCell + { + public UnevenViewCell() + { + + var label = new Label(); + label.SetBinding(Label.TextProperty, "FullName"); + Height = Bugzilla56298.Count % 2 == 0 ? 50 : 100; + View = label; + View.BackgroundColor = Bugzilla56298.Count % 2 == 0 ? Colors.Pink : Colors.LightYellow; + Bugzilla56298.Count++; + } + } + + [Preserve(AllMembers = true)] + class Person1 + { + public string FullName { get; set; } + public string Address { get; set; } + } + + class Group : ObservableCollection + { + public string Key { get; set; } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla56771.cs b/src/Controls/tests/TestCases/Issues/Bugzilla56771.cs new file mode 100644 index 000000000000..d969b55009ac --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla56771.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 56771, "Multi-item add in INotifyCollectionChanged causes a NSInternalInconsistencyException in bindings on iOS", PlatformAffected.iOS)] + public class Bugzilla56771 : TestContentPage + { + const string Success = "Success"; + const string BtnAdd = "btnAdd"; + OptimizedCollection data = new OptimizedCollection(); + int i = 4; + + private void InitializeData() + { + + data.Add("Item 1"); + data.Add("Item 2"); + data.Add("Item 3"); + data.Add("Item 4"); + BindingContext = data; + } + + protected override void Init() + { + data.CollectionChanged += (_, e) => + { + var log = $"<{DateTime.Now.ToString("T")}> {e.Action} action fired."; + System.Diagnostics.Debug.WriteLine(log); + }; + var label = new Label { Text = "Click the Add 2 button." }; + var button = new Button + { + Text = "Add 2", + AutomationId = BtnAdd, + Command = new Command(() => + { + try + { + data.AddRange($"Item {++i}", $"Item {++i}"); + } + catch (ArgumentException) + { + label.Text = Success; + } + }) + }; + var button1 = new Button + { + Text = "Remove 2", + Command = new Command(() => + { + if (data.Count > 1) + { + data.RemoveRangeAt(0, 2); + } + }) + }; + var button2 = new Button + { + Text = "Clear", + Command = new Command(() => + { + data.RemoveRangeAt(0, data.Count); + }) + }; + var listView = new ListView { }; + listView.SetBinding(ListView.ItemsSourceProperty, "."); + + Content = new StackLayout + { + Children = { label, button, button1, button2, listView } + }; + + InitializeData(); + } + + [Preserve(AllMembers = true)] + public class OptimizedCollection : ObservableCollection + { + public OptimizedCollection() + { + } + + protected override void ClearItems() + { + base.ClearItems(); + } + + public void AddRange(params T[] items) + { + InsertRangeAt(this.Count, items); + } + + public void InsertRangeAt(int startIndex, params T[] items) + { + int idx = this.Count; + foreach (var item in items) + { + base.Items.Insert(startIndex++, item); + } + if (idx < Count) + { + OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changedItems: items.ToList(), startingIndex: startIndex)); + OnPropertyChanged(new PropertyChangedEventArgs(nameof(Count))); + OnPropertyChanged(new PropertyChangedEventArgs("Item[]")); + } + } + + public void RemoveRangeAt(int startIndex, int count) + { + if (count > 0) + { + List removedItems = new List(count); + for (int i = 0; i < count; i++) + { + removedItems.Add(base.Items[startIndex]); + base.Items.RemoveAt(startIndex); + } + OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, changedItems: removedItems, startingIndex: startIndex++)); + OnPropertyChanged(new PropertyChangedEventArgs(nameof(Count))); + OnPropertyChanged(new PropertyChangedEventArgs("Item[]")); + } + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla56896.cs b/src/Controls/tests/TestCases/Issues/Bugzilla56896.cs new file mode 100644 index 000000000000..98faf30f2c1b --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla56896.cs @@ -0,0 +1,210 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 56896, "ListViews for lists with many elements regressed in performance on iOS", PlatformAffected.iOS)] + public class Bugzilla56896 : TestContentPage + { + const string Instructions = "The number in blue is the number of constructor calls. The number in purple is the initial load time in milliseconds."; + const string InstructionsId = "InstructionsId"; + const string ConstructorCountId = "constructorCount"; + const string TimeId = "time"; + + [Preserve(AllMembers = true)] + class MyViewModel : INotifyPropertyChanged + { + int _constructorCallCount; + + public int ConstructorCallCount + { + get { return _constructorCallCount; } + set + { + _constructorCallCount = value; + OnPropertyChanged(); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + + [Preserve(AllMembers = true)] + class Fizz : ViewCell + { + readonly MyViewModel _vm; + + Label myLabel; + public Fizz(MyViewModel vm) + { + _vm = vm; + + vm.ConstructorCallCount++; + + Height = 30; + + myLabel = new Label { Text = "fizz" }; + View = myLabel; + } + ~Fizz() + { + _vm.ConstructorCallCount--; + } + } + + [Preserve(AllMembers = true)] + class Buzz : ViewCell + { + readonly MyViewModel _vm; + + Label myLabel; + public Buzz(MyViewModel vm) + { + _vm = vm; + + vm.ConstructorCallCount++; + + Height = 50; + + myLabel = new Label { Text = "buzz" }; + View = myLabel; + } + ~Buzz() + { + _vm.ConstructorCallCount--; + } + } + + [Preserve(AllMembers = true)] + class Fizzbuzz : ViewCell + { + readonly MyViewModel _vm; + + Label myLabel; + public Fizzbuzz(MyViewModel vm) + { + _vm = vm; + + vm.ConstructorCallCount++; + + Height = 150; + + myLabel = new Label { Text = "fizzbuzz" }; + View = myLabel; + } + ~Fizzbuzz() + { + _vm.ConstructorCallCount--; + } + } + + [Preserve(AllMembers = true)] + class Number : ViewCell + { + readonly MyViewModel _vm; + + Label myLabel; + public Number(MyViewModel vm) + { + _vm = vm; + + vm.ConstructorCallCount++; + + Height = 44; + + myLabel = new Label(); + myLabel.SetBinding(Label.TextProperty, "."); + View = myLabel; + } + ~Number() + { + _vm.ConstructorCallCount--; + } + } + + class MyDataTemplateSelector : DataTemplateSelector + { + DataTemplate _fizzbuzz; + DataTemplate _fizz; + DataTemplate _buzz; + DataTemplate _number; + + public MyDataTemplateSelector(MyViewModel vm) + { + _fizzbuzz = new DataTemplate(() => new Fizzbuzz(vm)); + _fizz = new DataTemplate(() => new Fizz(vm)); + _buzz = new DataTemplate(() => new Buzz(vm)); + _number = new DataTemplate(() => new Number(vm)); + } + + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + int number = (int)item; + + if (number % 15 == 0) + return _fizzbuzz; + else if (number % 5 == 0) + return _buzz; + else if (number % 3 == 0) + return _fizz; + else + return _number; + } + } + + + Label _timeLabel = new Label { TextColor = Colors.Purple, AutomationId = TimeId }; + Stopwatch _timer = new Stopwatch(); + ListView _listView; + protected override void Init() + { + _timer.Start(); + var vm = new MyViewModel(); + + BindingContext = vm; + + var label = new Label { TextColor = Colors.Blue, AutomationId = ConstructorCountId }; + label.SetBinding(Label.TextProperty, nameof(vm.ConstructorCallCount)); + + _listView = new ListView(ListViewCachingStrategy.RecycleElement) + { + HasUnevenRows = true, + // Set the RowHeight to enable optimal performance and minimal constructor calls. + // It will still use the specified Cell heights on final measure. + // Note, however, that doing this negates the fix for Bugzilla 43313, so if user expects + // to add items to the bottom of this list and scroll smoothly, user should omit the RowHeight + // and rely solely on the Cell heights. This will cause each row to be constructed at least once, + // but it will allow the ListView to estimate the height properly for smooth scrolling. + // Also note that performance will degrade if the first cell does not have a specified height or + // if most of the cells do not have a specified height. It is recommended to specify a height on all + // or none of the cells when possible. + RowHeight = 50, + ItemsSource = Enumerable.Range(1, 5001), + ItemTemplate = new MyDataTemplateSelector(vm) + }; + Content = new StackLayout { Children = { new Label { Text = Instructions, AutomationId = InstructionsId }, label, _timeLabel, _listView } }; + } + + protected override void OnAppearing() + { + base.OnAppearing(); + + _timer.Stop(); + _timeLabel.Text = _timer.ElapsedMilliseconds.ToString(); + _timer.Reset(); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla57114.cs b/src/Controls/tests/TestCases/Issues/Bugzilla57114.cs new file mode 100644 index 000000000000..8bc25612a139 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla57114.cs @@ -0,0 +1,92 @@ +using System; +using System.Diagnostics; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 57114, "Forms gestures are not supported on UIViews that have native gestures", PlatformAffected.iOS)] + public class Bugzilla57114 : TestContentPage + { + public static string _57114NativeGestureFiredMessage = "_57114NativeGestureFiredMessage"; + + Label _results; + bool _nativeGestureFired; + bool _formsGestureFired; + + const string Testing = "Testing..."; + const string Success = "Success"; + const string ViewAutomationId = "_57114View"; + + protected override void Init() + { + var instructions = new Label + { + Text = $"Tap the Aqua View below. If the label below changes from '{Testing}' to '{Success}', the test has passed." + }; + + _results = new Label { Text = Testing }; + + var view = new _57114View + { + AutomationId = ViewAutomationId, + HeightRequest = 200, + WidthRequest = 200, + BackgroundColor = Colors.Aqua, + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill + }; + + var tap = new TapGestureRecognizer + { + Command = new Command(() => + { + _formsGestureFired = true; + UpdateResults(); + }) + }; + + MessagingCenter.Subscribe(this, _57114NativeGestureFiredMessage, NativeGestureFired); + + view.GestureRecognizers.Add(tap); + + var layout = new StackLayout() + { + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill, + Children = + { + instructions, _results, view + } + }; + + Content = layout; + } + + void NativeGestureFired(object obj) + { + _nativeGestureFired = true; + UpdateResults(); + } + + void UpdateResults() + { + if (_nativeGestureFired && _formsGestureFired) + { + _results.Text = Success; + } + else + { + _results.Text = Testing; + } + } + + [Preserve(AllMembers = true)] + public class _57114View : View + { + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla57674.cs b/src/Controls/tests/TestCases/Issues/Bugzilla57674.cs new file mode 100644 index 000000000000..ac7ccf47ab1b --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla57674.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 57674, "ListView not honoring INotifyCollectionChanged ", PlatformAffected.UWP)] + public class Bugzilla57674 : TestContentPage + { + MyCollection _myCollection; + protected override void Init() + { + // Initialize ui here instead of ctor + _myCollection = new MyCollection(); + + var stackLayout = new StackLayout(); + var button = new Button + { + AutomationId = "IssueButton", + Text = "Add new element to ListView" + }; + button.Clicked += (object sender, EventArgs e) => _myCollection.AddNewItem(); + + stackLayout.Children.Add(button); + + stackLayout.Children.Add(new ListView + { + AutomationId = "IssueListView", + ItemsSource = _myCollection + }); + + Content = stackLayout; + } + } + + public class MyCollection : IEnumerable, INotifyCollectionChanged + { + readonly List _internalList = new List(); + public MyCollection() + { + } + + public IEnumerable GetItems() + { + foreach (var item in _internalList) + { + yield return item; + } + } + + public IEnumerator GetEnumerator() + { + return GetItems().GetEnumerator(); + } + + public void AddNewItem() + { + int index = _internalList.Count; + string item = Guid.NewGuid().ToString(); + _internalList.Add(item); + OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); + } + + public event NotifyCollectionChangedEventHandler CollectionChanged; + + protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e) + { + CollectionChanged?.Invoke(this, e); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla57758.cs b/src/Controls/tests/TestCases/Issues/Bugzilla57758.cs new file mode 100644 index 000000000000..50224aeea50b --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla57758.cs @@ -0,0 +1,37 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 57758, "ObjectDisposedException for Microsoft.Maui.Controls.Platform.Android.FastRenderers.ImageRenderer", PlatformAffected.Android)] + public class Bugzilla57758 : TestContentPage + { + const string ImageId = "TestImageId"; + + protected override void Init() + { + var testImage = new Image { Source = "coffee.png", AutomationId = ImageId }; + + var layout = new StackLayout + { + Padding = new Thickness(0, 20, 0, 0), + Children = + { + testImage + } + }; + + var tapGesture = new TapGestureRecognizer + { + NumberOfTapsRequired = 1, + Command = new Command(() => layout.Children.Remove(testImage)) + }; + + testImage.GestureRecognizers.Add(tapGesture); + + Content = layout; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla57910.cs b/src/Controls/tests/TestCases/Issues/Bugzilla57910.cs new file mode 100644 index 000000000000..649715e62988 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla57910.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 57910, "ObjectDisposedException in Microsoft.Maui.Controls.Platform.Android.Renderers.ProgressBarRenderer", PlatformAffected.Android)] + public class Bugzilla57910 : QuickCollectNavigationPage + { + const string ButtonId = "btnPush"; + const string Button2Id = "btnPop"; + const string Instructions = "Tap Push. Then quickly tap Pop on the subsequent screen. Do this several times. If there is no crash, then this test has passed."; + const string Instructions2 = "Tap Pop. Then quickly tap Push on the subsequent screen. Do this several times. If there is no crash, then this test has passed."; + + protected override void Init() + { + Navigation.PushAsync(new HomePage()); + } + + [Preserve(AllMembers = true)] + class HomePage : ContentPage + { + public HomePage() + { + Button button = new Button { Text = "Push", AutomationId = ButtonId }; + + button.Clicked += Button_Clicked; + + Content = new StackLayout { Children = { new Label { Text = Instructions }, button } }; + } + + async void Button_Clicked(object sender, EventArgs e) + { + await Navigation.PushAsync(new ListPage()); + GarbageCollectionHelper.Collect(); + } + } + + [Preserve(AllMembers = true)] + class ListItemView : ViewCell + { + public ListItemView() + { + ProgressBar progressBar = new ProgressBar { IsVisible = false }; + progressBar.SetBinding(ProgressBar.ProgressProperty, nameof(ListItemViewModel.DownloadProgressPercentage)); + + // Need a trigger to set a property on a VisualElement. Not actually specific to ProgressBar. + DataTrigger newDataTrigger = new DataTrigger(typeof(ProgressBar)) { Binding = new Binding(nameof(ListItemViewModel.State)), Value = ListItemViewModel.InstallableState.Downloading }; + newDataTrigger.Setters.Add(new Setter { Property = ProgressBar.IsVisibleProperty, Value = true }); + progressBar.Triggers.Add(newDataTrigger); + + View = new ContentView { Content = new StackLayout { Children = { progressBar } } }; + } + } + + [Preserve(AllMembers = true)] + class ListHeaderView : ContentView + { + public ListHeaderView() + { + Label newLabel = new Label(); + newLabel.SetBinding(Label.TextProperty, nameof(ListPageViewModel.Header)); + Content = newLabel; + } + } + + [Preserve(AllMembers = true)] + class ListFooterView : ContentView + { + public ListFooterView() + { + Label newLabel = new Label(); + newLabel.SetBinding(Label.TextProperty, nameof(ListPageViewModel.Footer)); + + var stack = new StackLayout { Children = { newLabel } }; + Content = stack; + } + } + + [Preserve(AllMembers = true)] + class ListPageViewModel : INotifyPropertyChanged + { + ObservableCollection _items; + string _footer; + string _header; + + int _counter; + public ListPageViewModel() + { + _header = "Header!"; + _footer = "Footer!"; + _counter = 0; + _items = new ObservableCollection(Enumerable.Range(0, 100).Select(c => new ListItemViewModel())); + + // Need an asynchronous action that happens sometime between creation of the Element and Pop of the containing page + Device.StartTimer(TimeSpan.FromMilliseconds((100)), () => + { + Header = $"Header! {_counter++}"; + Footer = $"Footer! {_counter++}"; + + return true; + }); + } + + public event PropertyChangedEventHandler PropertyChanged; + + public ObservableCollection Items + { + get { return _items; } + set + { + _items = value; + OnPropertyChanged(nameof(Items)); + } + } + + public string Header + { + get { return _header; } + set + { + _header = value; + OnPropertyChanged(nameof(Header)); + } + } + + public string Footer + { + get { return _footer; } + set + { + _footer = value; + OnPropertyChanged(nameof(Footer)); + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + + [Preserve(AllMembers = true)] + class ListItemViewModel : INotifyPropertyChanged + { + double _downloadProgressPercentage; + + InstallableState _state; + + public ListItemViewModel() + { + DownloadProgressPercentage = 0d; + State = InstallableState.Downloading; + + // Need an asynchronous action that happens sometime between creation of the Element and Pop of the containing page + Device.StartTimer(TimeSpan.FromMilliseconds((1000)), () => + { + DownloadProgressPercentage += 0.05d; + if (DownloadProgressPercentage > 0.99d) + { + State = InstallableState.Local; + } + + return DownloadProgressPercentage != 1.0d; + }); + } + + public event PropertyChangedEventHandler PropertyChanged; + + public enum InstallableState + { + Local, + Downloading + } + + public double DownloadProgressPercentage + { + get { return _downloadProgressPercentage; } + set + { + _downloadProgressPercentage = value; + OnPropertyChanged(nameof(DownloadProgressPercentage)); + } + } + + public InstallableState State + { + get { return _state; } + set + { + _state = value; + OnPropertyChanged(nameof(State)); + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + + [Preserve(AllMembers = true)] + class ListPage : ContentPage + { + public ListPage() + { + ListView listView = new ListView(ListViewCachingStrategy.RecycleElement) + { + RowHeight = 70, + ItemTemplate = new DataTemplate(typeof(ListItemView)), + HeaderTemplate = new DataTemplate(typeof(ListHeaderView)), + FooterTemplate = new DataTemplate(typeof(ListFooterView)), + }; + + listView.SetBinding(ListView.ItemsSourceProperty, nameof(ListPageViewModel.Items)); + listView.SetBinding(ListView.HeaderProperty, "."); + listView.SetBinding(ListView.FooterProperty, "."); + + Button newButton = new Button { Text = "Pop", AutomationId = Button2Id }; + newButton.Clicked += NewButton_Clicked; + Content = new StackLayout { Children = { new Label { Text = Instructions2 }, newButton, listView } }; + + BindingContext = new ListPageViewModel(); + } + + void NewButton_Clicked(object sender, EventArgs e) + { + Navigation.PopAsync(); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla58645.cs b/src/Controls/tests/TestCases/Issues/Bugzilla58645.cs new file mode 100644 index 000000000000..14f960bef9d5 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla58645.cs @@ -0,0 +1,130 @@ +using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 58645, "[iOS] NRE Thrown When ListView Items Are Replaced By Items With a Different Template", PlatformAffected.iOS)] + public class Bugzilla58645 : TestContentPage + { + const string ButtonId = "button"; + ObservableCollection Items { get; set; } + + protected override void Init() + { + Items = new ObservableCollection { "Item 1A", "Item 2A", "Item 3A" }; + + var myListView = new ListView + { + HasUnevenRows = true, + ItemsSource = Items, + ItemTemplate = new LayoutTemplateSelector + { + LayoutA = new DataTemplate(typeof(LayoutA)), + LayoutB = new DataTemplate(typeof(LayoutB)) + } + }; + + var switchBtn = new Button + { + Text = "Switch Items", + AutomationId = ButtonId, + Command = new Command(() => + { + Items.Clear(); + Items.Add("Item 1B"); + }) + }; + + Content = new StackLayout + { + Children = + { + new Label { Text = "Tap the 'Switch Items' button. If the app does not crash, this test has passed." }, + switchBtn, + myListView + } + }; + } + + [Preserve(AllMembers = true)] + public class LayoutA : ViewCell + { + public LayoutA() + { + var layout = new Grid + { + Padding = new Thickness(14), + ColumnDefinitions = + { + new ColumnDefinition { Width = GridLength.Auto }, + new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } + }, + RowDefinitions = + { + new RowDefinition { Height = GridLength.Auto } + } + }; + + var mainLabel = new Label(); + mainLabel.SetBinding(Label.TextProperty, "."); + + var sw = new Switch(); + layout.Children.Add(mainLabel, 0, 0); + layout.Children.Add(sw, 2, 0); + View = layout; + } + } + + [Preserve(AllMembers = true)] + public class LayoutB : ViewCell + { + public LayoutB() + { + var layout = new Grid + { + Padding = new Thickness(14), + ColumnDefinitions = + { + new ColumnDefinition { Width = GridLength.Auto }, + new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } + }, + RowDefinitions = + { + new RowDefinition { Height = GridLength.Auto } + } + }; + + var mainLabel = new Label(); + mainLabel.SetBinding(Label.TextProperty, "."); + + var secondLabel = new Label + { + Text = "B" + }; + + layout.Children.Add(mainLabel, 0, 0); + layout.Children.Add(secondLabel, 2, 0); + View = layout; + } + } + + [Preserve(AllMembers = true)] + public class LayoutTemplateSelector : DataTemplateSelector + { + public DataTemplate LayoutA { get; set; } + public DataTemplate LayoutB { get; set; } + + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + if (item == null) + return LayoutA; + + var text = (string)item; + return text.Contains("A") ? LayoutA : LayoutB; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla59097.cs b/src/Controls/tests/TestCases/Issues/Bugzilla59097.cs new file mode 100644 index 000000000000..f7a9f1083e6a --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla59097.cs @@ -0,0 +1,36 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 59097, "[Android] Calling PopAsync via TapGestureRecognizer causes an application crash", PlatformAffected.Android)] + public class Bugzilla59097 : TestNavigationPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + Navigation.PushAsync(new ContentPage { Content = new Label { Text = "previous page " } }); + Navigation.PushAsync(new ToPopPage()); + } + + public class ToPopPage : ContentPage + { + public ToPopPage() + { + var boxView = new BoxView { WidthRequest = 100, HeightRequest = 100, Color = Colors.Red, AutomationId = "boxView" }; + var tapGesture = new TapGestureRecognizer { NumberOfTapsRequired = 1, Command = new Command(PopPageBack) }; + boxView.GestureRecognizers.Add(tapGesture); + var layout = new StackLayout(); + layout.Children.Add(boxView); + Content = layout; + } + + async void PopPageBack(object obj) + { + await Navigation.PopAsync(true); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla59172.cs b/src/Controls/tests/TestCases/Issues/Bugzilla59172.cs new file mode 100644 index 000000000000..dfd3b06bd9d6 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla59172.cs @@ -0,0 +1,77 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, + 59172, "[iOS] Popped page does not appear on top of current navigation stack, please file a bug.", + PlatformAffected.iOS)] + public class Bugzilla59172 : TestNavigationPage + { + protected override void Init() + { + var firstPage = new TestPage(); + Navigation.PushAsync(firstPage); + } + + [Preserve(AllMembers = true)] + public class TestPage : ContentPage + { + TestPage parent; + Label navigationErrorLabel = new Label(); + + public TestPage(TestPage parentPage = null) + { + this.parent = parentPage; + + var layout = new StackLayout(); + + var forwardButton = new Button { Text = "Forward", AutomationId = "GoForward" }; + layout.Children.Add(forwardButton); + forwardButton.Clicked += Forward_OnClicked; + + if (parentPage != null) + { + var backButton = new Button { Text = "Back (Delayed)", AutomationId = "GoBackDelayed" }; + layout.Children.Add(backButton); + backButton.Clicked += (a, b) => BackButtonPress(false); + + var backButtonSafe = new Button { Text = "Back (Delayed; Safe)", AutomationId = "GoBackDelayedSafe" }; + layout.Children.Add(backButtonSafe); + backButtonSafe.Clicked += (a, b) => BackButtonPress(true); + } + + layout.Children.Add(navigationErrorLabel); + + Content = layout; + } + + void Forward_OnClicked(object sender, EventArgs e) + { + Navigation.PushAsync(new TestPage(this)); + } + + async void BackButtonPress(bool safe) + { + try + { + // Assume some workload that delays the back navigation + await Task.Delay(2500); + + await Navigation.PopAsync(); + } + catch (Exception ex) + { + if (!safe) + { throw; } + + parent.navigationErrorLabel.Text = ex.Message; + } + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla59896.cs b/src/Controls/tests/TestCases/Issues/Bugzilla59896.cs new file mode 100644 index 000000000000..0f1bafe2de8c --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla59896.cs @@ -0,0 +1,86 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 59896, "v2.4.0: Adding inserting section to ListView causes crash IF first section is empty ", PlatformAffected.iOS)] + public class Bugzilla59896 : TestContentPage + { + const string btnAdd = "btnAdd"; + int _newGroupIndex = 0; + + protected override void Init() + { + var group1 = new Group("group A"); + var group2 = new Group("group C") + { + "item 1", "item 2" + }; + var source = new ObservableCollection + { + group1, group2 + }; + + var button = new Button + { + Text = "Add Group between A & C", + AutomationId = btnAdd + }; + + button.Clicked += (sender, e) => + { + var group = new Group("New Group " + _newGroupIndex) + { + "new Group["+_newGroupIndex+" ].A", "new Group["+_newGroupIndex+" ].B", + }; + _newGroupIndex++; + source.Insert(1, group); + }; + + Content = new StackLayout + { + Children = + { + new Label { Text = "Clicking the Add Group between A & C button should NOT cause an ArgumentException." }, + button, + new ListView + { + ItemsSource = source, + GroupDisplayBinding = new Binding("Title"), + IsGroupingEnabled = true + } + } + }; + + } + + [Preserve(AllMembers = true)] + public class Group : List + { + public string Title + { + get; + set; + } + + public Group() { } + + public Group(string title) + { + Title = title; + } + } + + [Preserve(AllMembers = true)] + public class GroupHeaderView + { + public GroupHeaderView() + { + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Bugzilla59925.cs b/src/Controls/tests/TestCases/Issues/Bugzilla59925.cs new file mode 100644 index 000000000000..c7820c2ee89d --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Bugzilla59925.cs @@ -0,0 +1,51 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 59925, "Font size does not change vertical height of Entry on iOS", PlatformAffected.Default)] + public class Bugzilla59925 : TestContentPage // or TestFlyoutPage, etc ... + { + const int Delta = 1; + Entry _entry; + + private void ChangeFontSize(int delta) + { + _entry.FontSize += delta; + } + + protected override void Init() + { + _entry = new Entry + { + Text = "Hello World!" + }; + + var buttonBigger = new Button + { + Text = "Bigger", + }; + buttonBigger.Clicked += (x, o) => ChangeFontSize(Delta); + + var buttonSmaller = new Button + { + Text = "Smaller" + }; + buttonSmaller.Clicked += (x, o) => ChangeFontSize(-Delta); + + var stack = new StackLayout + { + Children = { + buttonBigger, + buttonSmaller, + _entry + } + }; + + // Initialize ui here instead of ctor + Content = stack; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/GitHub1567.cs b/src/Controls/tests/TestCases/Issues/GitHub1567.cs new file mode 100644 index 000000000000..7d14ef0bbffa --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/GitHub1567.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.ObjectModel; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Input; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 1567, "NRE using TapGestureRecognizer on cell with HasUnevenRows", PlatformAffected.iOS, issueTestNumber: 1)] + public class GitHub1567 : TestContentPage // or TestFlyoutPage, etc ... + { + ICommand SomeCommand; + ObservableCollection LocalList { get; set; } = new ObservableCollection(); + + protected override async void Init() + { + // Initialize ui here instead of ctor + var btn = new Button + { + AutomationId = "btnFillData", + Text = "FILL DATA", + Command = new Command(async () => { await FillData(); }) + }; + var lst = new ListView(ListViewCachingStrategy.RecycleElement) + { + Header = btn, + HasUnevenRows = true, + RowHeight = -1, + SeparatorVisibility = SeparatorVisibility.None, + ItemsSource = LocalList, + ItemTemplate = new DataTemplate(typeof(CustomCell)) + }; + + Content = lst; + this.BindingContext = this; + SomeCommand = new Command(SomeCommandAction); + await FillData(); + } + + [Preserve(AllMembers = true)] + class CustomCell : ViewCell + { + public CustomCell() + { + var lbl = new Label { FontSize = 14 }; + lbl.SetBinding(Label.TextProperty, "Value1"); + var grd = new Grid(); + var boxView = new BoxView + { + BackgroundColor = Colors.Transparent, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand + }; + var gesture = new TapGestureRecognizer(); + gesture.SetBinding(TapGestureRecognizer.CommandProperty, "SomeCommand"); + boxView.GestureRecognizers.Add(gesture); + grd.Children.Add(lbl); + grd.Children.Add(boxView); + View = grd; + } + } + + void SomeCommandAction(object obj) + { + } + + async Task FillData() + { + await Task.Factory.StartNew(async () => + { + await Task.Delay(100); + LocalList.Clear(); + for (int i = 0; i < 100; i++) + { + LocalList.Add(new LocalIem() + { + Value1 = DateTime.UtcNow.Ticks.ToString(), + }); + } + }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); + } + + [Preserve(AllMembers = true)] + class LocalIem + { + public string Value1 { get; set; } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/GitHub1648.cs b/src/Controls/tests/TestCases/Issues/GitHub1648.cs new file mode 100644 index 000000000000..3e6c14852dae --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/GitHub1648.cs @@ -0,0 +1,49 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 1648, "FlyoutPage throws ArgumentOutOfRangeException", PlatformAffected.UWP)] + public class GitHub1648 : TestNavigationPage + { + protected override void Init() + { + Navigation.PushAsync(new FlyoutPage + { + Flyout = new NavigationPage(new ContentPage()) + { + Title = "Flyout" + }, + Detail = new ContentPage(), + }); + } + + protected override void OnAppearing() + { + base.OnAppearing(); + Navigation.PushModalAsync(new SimplePage()); + } + + class SimplePage : ContentPage + { + public SimplePage() + { + Content = new StackLayout() + { + Children = { + new Label { + Text = "Success" + }, + new Button + { + Text = "Reload", + Command = new Command(() => Navigation.PopModalAsync()) + } + } + }; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Github1625.cs b/src/Controls/tests/TestCases/Issues/Github1625.cs new file mode 100644 index 000000000000..0f734d024e83 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Github1625.cs @@ -0,0 +1,49 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 1625, "Slider value is not changed for the first position change", PlatformAffected.Android)] + public class Github1625 : TestContentPage + { + protected override void Init() + { + var slider = new Slider(); + slider.Maximum = 10; + slider.Minimum = 1; + slider.Value = 5; + + var valueLabel = new Label() { AutomationId = "LabelValue" }; + var stack = new StackLayout { Orientation = StackOrientation.Vertical, Spacing = 15 }; + + valueLabel.SetBinding(Label.TextProperty, new Binding("Value", source: slider)); + stack.Children.Add(valueLabel); + stack.Children.Add(slider); + + var button = new Button + { + Text = "Set to 7", + AutomationId = "SetTo7", + Command = new Command(() => slider.Value = 7) + }; + + stack.Children.Add(button); + + var label = new Label + { + Text = "On start, slider value should show 5 even though SeekBar is 4.996. Sliding back and forth should update the label and the tracker. Tapping on a slider position should do the same. Tapping on the button should show 7 even though SeekBar is 6.994." + }; + stack.Children.Add(label); + + var labelAccessibility = new Label + { + Text = "Turn on a screen reader and use the volume buttons to modify the slider value. Ensure that the slider value on the label updates correctly." + }; + stack.Children.Add(labelAccessibility); + + Content = stack; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Github6384.cs b/src/Controls/tests/TestCases/Issues/Github6384.cs new file mode 100644 index 000000000000..973d128e8b90 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Github6384.cs @@ -0,0 +1,65 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 6384, "content page in tabbed page not showing inside shell tab", PlatformAffected.iOS | PlatformAffected.Android)] + public class Github6384 : TestShell + { + protected override void Init() + { + var tabOneButton = new Button + { + AutomationId = "NavigationButton", + Text = "Push me!" + }; + + tabOneButton.Clicked += TabOneButton_Clicked; + + var tabOnePage = new ContentPage { Content = tabOneButton }; + + var tabTwoPage = new ContentPage { Content = new Label { Text = "Go to TabOne" } }; + var tabOne = new Tab { Title = "TabOne" }; + var tabTwo = new Tab { Title = "TabTwo" }; + tabOne.Items.Add(tabOnePage); + tabTwo.Items.Add(tabTwoPage); + + Items.Add( + new TabBar + { + Items = { tabOne, tabTwo } + } + ); + } + + private void TabOneButton_Clicked(object sender, System.EventArgs e) + { + var subTabPageOne = new ContentPage + { + Content = new Label + { + Text = "SubPage One", + AutomationId = "SubTabLabel1", + VerticalTextAlignment = TextAlignment.Center, + } + }; + var subTabPageTwo = new ContentPage + { + Content = new Label + { + Text = "SubPage Two", + AutomationId = "SubTabLabel2", + VerticalTextAlignment = TextAlignment.Center, + } + }; + + var tabbedPage = new TabbedPage { Title = "TabbedPage" }; + tabbedPage.Children.Add(subTabPageOne); + tabbedPage.Children.Add(subTabPageTwo); + Shell.SetTabBarIsVisible(tabbedPage, false); + this.Navigation.PushAsync(tabbedPage); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Issue10182.cs b/src/Controls/tests/TestCases/Issues/Issue10182.cs new file mode 100644 index 000000000000..8fc753c27950 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue10182.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10182, "[Bug] Exception Ancestor must be provided for all pushes except first", PlatformAffected.Android, NavigationBehavior.SetApplicationRoot)] + public class Issue10182 : TestContentPage + { + public Issue10182() + { + + } + + protected override void Init() + { + Content = new StackLayout() + { + Children = + { + new Label() + { + Text = "Starting Activity to Test Changing Page on Resume. If success label shows up test has passed." + } + } + }; + +#if !UITEST + Device.BeginInvokeOnMainThread(() => + { + DependencyService.Get().OpenWindow(this.GetType()); + }); +#endif + + } + + public class Issue10182SuccessPage : ContentPage + { + public Issue10182SuccessPage() + { + Content = new StackLayout() + { + Children = + { + new Label() + { + Text = "Success.", + AutomationId = "Success" + } + } + }; + } + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Issue10222.cs b/src/Controls/tests/TestCases/Issues/Issue10222.cs new file mode 100644 index 000000000000..34507a81a849 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue10222.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10222, "[CollectionView] ObjectDisposedException if the page is closed during scrolling", PlatformAffected.iOS)] + public class Issue10222 : TestNavigationPage // or TestFlyoutPage, etc ... + { + protected override void Init() + { + // Initialize ui here instead of ctor + Navigation.PushAsync(new ContentPage + { + Content = new Button + { + AutomationId = "goTo", + Text = "Go", + Command = new Command(async () => await Navigation.PushAsync(new CarouselViewTestPage())) + } + }); + } + + class CarouselViewTestPage : ContentPage + { + CollectionView cv; + public CarouselViewTestPage() + { + cv = new CollectionView + { + AutomationId = "collectionView", + Margin = new Thickness(0, 40), + ItemTemplate = new DataTemplate(() => + { + var label = new Label + { + HorizontalTextAlignment = TextAlignment.Center, + Margin = new Thickness(0, 100) + }; + label.SetBinding(Label.TextProperty, new Binding(".")); + return label; + }) + }; + Content = cv; + InitCV(); + } + + async void InitCV() + { + var items = new List(); + for (int i = 0; i < 10; i++) + { + items.Add($"items{i}"); + } + + cv.ItemsSource = items; + + //give the cv time to draw the items + await Task.Delay(1000); + + cv.ScrollTo(items.Count - 1); + + //give the cv time to scroll + var rand = new Random(); + await Task.Delay(rand.Next(10, 200)); + + await Navigation.PopAsync(false); + + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue10454.cs b/src/Controls/tests/TestCases/Issues/Issue10454.cs new file mode 100644 index 000000000000..6970138b5c4a --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue10454.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.ObjectModel; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10454, "CollectionView ChildAdded", PlatformAffected.All)] + public class Issue10454 : TestContentPage + { + const string Success = "Success"; + + protected override void Init() + { + Title = "Issue 10454"; + + BindingContext = new Issue10454ViewModel(); + + var layout = new StackLayout(); + + var collectionView = new CollectionView(); + collectionView.SetBinding(ItemsView.ItemsSourceProperty, "Items"); + + collectionView.ItemTemplate = new DataTemplate(() => + { + var template = new DataTemplate(); + var content = new Grid + { + BackgroundColor = Colors.LightGray + }; + var label = new Label(); + label.SetBinding(Label.TextProperty, "."); + content.Children.Add(label); + + return content; + }); + + var labelInfo = new Label + { + FontSize = 18 + }; + + var successLabel = new Label(); + + layout.Children.Add(labelInfo); + layout.Children.Add(successLabel); + layout.Children.Add(collectionView); + + Content = layout; + + collectionView.ChildAdded += (sender, args) => + { + labelInfo.Text = $"ChildAdded {args.Element}"; + Console.WriteLine(labelInfo.Text); + + successLabel.Text = Success; + }; + + collectionView.ChildRemoved += (sender, args) => + { + labelInfo.Text = $"ChildRemoved {args.Element}"; + Console.WriteLine(labelInfo.Text); + }; + } + } + + [Preserve(AllMembers = true)] + public class Issue10454ViewModel : BindableObject + { + public Issue10454ViewModel() + { + LoadItems(); + } + + public ObservableCollection Items { get; set; } + + void LoadItems() + { + Items = new ObservableCollection(); + + for (int i = 0; i < 100; i++) + { + Items.Add($"Item {i + 1}"); + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue10563.cs b/src/Controls/tests/TestCases/Issues/Issue10563.cs new file mode 100644 index 000000000000..6381c6101639 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue10563.cs @@ -0,0 +1,138 @@ +using System.Collections.Generic; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10563, "[Bug] SwipeView Open methods does not work for RightItems", PlatformAffected.Android | PlatformAffected.iOS)] + public class Issue10563 : TestContentPage + { + const string OpenLeftId = "OpenLeftId"; + const string OpenRightId = "OpenRightId"; + const string OpenTopId = "OpenTopId"; + const string OpenBottomId = "OpenBottomId"; + const string CloseId = "CloseId"; + + public Issue10563() + { + + } + + protected override void Init() + { + Title = "Issue 10563"; + + var swipeLayout = new StackLayout + { + Margin = new Thickness(12) + }; + + var openLeftButton = new Button + { + AutomationId = OpenLeftId, + Text = "Open Left SwipeItem" + }; + + var openRightButton = new Button + { + AutomationId = OpenRightId, + Text = "Open Right SwipeItem" + }; + + var openTopButton = new Button + { + AutomationId = OpenTopId, + Text = "Open Top SwipeItem" + }; + + var openBottomButton = new Button + { + AutomationId = OpenBottomId, + Text = "Open Bottom SwipeItem" + }; + + var closeButton = new Button + { + AutomationId = CloseId, + Text = "Close SwipeView" + }; + + swipeLayout.Children.Add(openLeftButton); + swipeLayout.Children.Add(openRightButton); + swipeLayout.Children.Add(openTopButton); + swipeLayout.Children.Add(openBottomButton); + swipeLayout.Children.Add(closeButton); + + var swipeItem = new SwipeItem + { + BackgroundColor = Colors.Red, + IconImageSource = "calculator.png", + Text = "Issue 10563" + }; + + swipeItem.Invoked += (sender, e) => { DisplayAlert("SwipeView", "SwipeItem Invoked", "Ok"); }; + + var swipeItems = new SwipeItems { swipeItem }; + + swipeItems.Mode = SwipeMode.Reveal; + + var swipeContent = new Grid + { + BackgroundColor = Colors.Gray + }; + + var swipeLabel = new Label + { + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + Text = "Swipe to any direction" + }; + + swipeContent.Children.Add(swipeLabel); + + var swipeView = new SwipeView + { + HeightRequest = 60, + WidthRequest = 300, + LeftItems = swipeItems, + RightItems = swipeItems, + TopItems = swipeItems, + BottomItems = swipeItems, + Content = swipeContent, + Margin = new Thickness(0, 48) + }; + + swipeLayout.Children.Add(swipeView); + + Content = swipeLayout; + + openLeftButton.Clicked += (sender, e) => + { + swipeView.Open(OpenSwipeItem.LeftItems); + }; + + openRightButton.Clicked += (sender, e) => + { + swipeView.Open(OpenSwipeItem.RightItems); + }; + + openTopButton.Clicked += (sender, e) => + { + swipeView.Open(OpenSwipeItem.TopItems); + }; + + openBottomButton.Clicked += (sender, e) => + { + swipeView.Open(OpenSwipeItem.BottomItems); + }; + + closeButton.Clicked += (sender, e) => + { + swipeView.Close(); + }; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue10744.cs b/src/Controls/tests/TestCases/Issues/Issue10744.cs new file mode 100644 index 000000000000..01fdbe1cff2b --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue10744.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10744, "[Android] WebView.Eval crashes on Android with long string", + PlatformAffected.Android)] + public class Issue10744 : TestContentPage + { + Label _navigatedLabel; + WebView _webView; + + protected override void Init() + { + _navigatedLabel = new Label() + { + AutomationId = "navigatedLabel" + }; + + _webView = new WebView() + { + Source = "https://dotnet.microsoft.com/apps/xamarin", + Cookies = new System.Net.CookieContainer(), + HorizontalOptions = LayoutOptions.Fill, + VerticalOptions = LayoutOptions.Fill, + HeightRequest = 600 + }; + + _webView.Navigating += (_, __) => + { + }; + + _webView.Navigated += (_, __) => + { + if (_navigatedLabel.Text == "Navigated") + return; + + _webView.Eval($"javascript:{String.Join(":", Enumerable.Range(0, 900000).ToArray())}"); + _navigatedLabel.Text = "Navigated"; + }; + + Content = new StackLayout() + { + Children = + { + new Label(){ Text = "If App hasn't crashed after navigating to the web page then this test has passed"}, + _navigatedLabel, + _webView + } + }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Issue11132.cs b/src/Controls/tests/TestCases/Issues/Issue11132.cs new file mode 100644 index 000000000000..c383e8aa3ef1 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11132.cs @@ -0,0 +1,51 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11132, "[Bug] [iOS] UpdateClip throws NullReferenceException when the Name of the Mask of the Layer is null", PlatformAffected.iOS)] + public class Issue11132 : TestContentPage + { + const string InstructionsId = "instructions"; + + public Issue11132() + { + + } + + protected override void Init() + { + Title = "Issue 11132"; + + var layout = new StackLayout(); + + var instructions = new Label + { + AutomationId = InstructionsId, + Padding = 12, + BackgroundColor = Colors.Black, + TextColor = Colors.White, + Text = "If the test works without exceptions (an orange rectangle is rendered), the test has passed." + }; + + var issue11132Control = new Issue11132Control + { + HeightRequest = 100 + }; + + layout.Children.Add(instructions); + layout.Children.Add(issue11132Control); + + Content = layout; + } + } + + [Preserve(AllMembers = true)] + public class Issue11132Control : View + { + + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue11209.xaml b/src/Controls/tests/TestCases/Issues/Issue11209.xaml new file mode 100644 index 000000000000..875d35048415 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11209.xaml @@ -0,0 +1,58 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue11209.xaml.cs b/src/Controls/tests/TestCases/Issues/Issue11209.xaml.cs new file mode 100644 index 000000000000..07c940f34e84 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11209.xaml.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Controls.Xaml; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11209, "[Bug] [iOS][SwipeView] Swipe view not handling tap gesture events until swiped", PlatformAffected.Android)] + public partial class Issue11209 : TestContentPage + { + const string SwipeViewContent = "SwipeViewContent"; + const string Success = "Success"; + + public Issue11209() + { + InitializeComponent(); + } + + public List Items => new List { "short", "long word", "Extra long word", "word up" }; + + protected override void Init() + { + + } + + void SwipeItem_Invoked(object sender, EventArgs e) + { + Console.WriteLine("Hey i was invoked"); + } + + async void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + await Navigation.PushAsync(new Issue11209SecondPage()); + } + + [Preserve(AllMembers = true)] + public class Issue11209SecondPage : ContentPage + { + public Issue11209SecondPage() + { + Title = "Issue 11209"; + + var layout = new StackLayout(); + + var instructions = new Label + { + AutomationId = Success, + Padding = 12, + BackgroundColor = Colors.Black, + TextColor = Colors.White, + Text = "If navigated tapping an item from the CollectionView, the test has passed." + }; + + layout.Children.Add(instructions); + + Content = layout; + } + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue11311.cs b/src/Controls/tests/TestCases/Issues/Issue11311.cs new file mode 100644 index 000000000000..e223606e0ef3 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11311.cs @@ -0,0 +1,121 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Windows.Input; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Graphics; +using NUnit.Framework; + +namespace Maui.Controls.Sample.Issues +{ + [Issue(IssueTracker.None, 11311, "[Regression] CollectionView NSRangeException", PlatformAffected.iOS)] + public class Issue11311 : TestTabbedPage + { + const string Success = "Success"; + + protected override void Init() + { + Children.Add(FirstPage()); + Children.Add(CollectionViewPage()); + } + + ContentPage FirstPage() + { + var firstPage = new ContentPage + { + Title = "The first page", + Content = new Label { Text = Success } + }; + + firstPage.Appearing += (sender, args) => + { + if (firstPage.Parent is TabbedPage tabbedPage + && tabbedPage.Children[1] is ContentPage collectionViewPage + && collectionViewPage.Content is RefreshView refreshView) + { + refreshView.IsRefreshing = true; + } + }; + + return firstPage; + } + + ContentPage CollectionViewPage() + { + BindingContext = new _11311ViewModel(); + + var collectionView = new CollectionView + { + Footer = new BoxView { BackgroundColor = Colors.Red, HeightRequest = 53 } + }; + + collectionView.SetBinding(ItemsView.ItemsSourceProperty, nameof(_11311ViewModel.ScoreCollectionList)); + var refreshView = new RefreshView + { + Content = collectionView + }; + + + refreshView.SetBinding(RefreshView.CommandProperty, nameof(_11311ViewModel.PopulateCollectionCommand)); + refreshView.SetBinding(RefreshView.IsRefreshingProperty, nameof(_11311ViewModel.IsRefreshing)); + + var page = new ContentPage + { + Title = "CollectionView Page", + Content = refreshView + }; + + return page; + } + + class _11311ViewModel : INotifyPropertyChanged + { + bool _isRefreshing; + IEnumerable _scoreCollectionList; + + public _11311ViewModel() + { + PopulateCollectionCommand = new Command(ExecuteRefreshCommand); + _scoreCollectionList = Enumerable.Empty(); + } + + public event PropertyChangedEventHandler PropertyChanged; + + public ICommand PopulateCollectionCommand { get; } + + public IEnumerable ScoreCollectionList + { + get => _scoreCollectionList; + set + { + _scoreCollectionList = value; + OnPropertyChanged(); + } + } + + public bool IsRefreshing + { + get => _isRefreshing; + set + { + if (IsRefreshing != value) + { + _isRefreshing = value; + OnPropertyChanged(); + } + } + } + + void ExecuteRefreshCommand() + { + ScoreCollectionList = Enumerable.Range(0, 100); + IsRefreshing = false; + } + + void OnPropertyChanged([CallerMemberName] string propertyName = "") => + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Issue11333.xaml b/src/Controls/tests/TestCases/Issues/Issue11333.xaml new file mode 100644 index 000000000000..1d2a018f8250 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11333.xaml @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue11333.xaml.cs b/src/Controls/tests/TestCases/Issues/Issue11333.xaml.cs new file mode 100644 index 000000000000..ad1f7cd262a9 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11333.xaml.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11333, + "[Bug] SwipeView does not work on Android if child has TapGestureRecognizer", + PlatformAffected.Android)] + public partial class Issue11333 : TestContentPage + { + const string SwipeViewId = "SwipeViewId"; + + public Issue11333() + { + InitializeComponent(); + } + + protected override void Init() + { + } + + void OnTapGestureRecognizerOnTapped(object sender, EventArgs e) + { + Debug.WriteLine("Tapped"); + } + + void OnSwipeViewSwipeEnded(object sender, SwipeEndedEventArgs e) + { + ResultLabel.Text = e.IsOpen ? "Open" : "Close"; + } + } + + [Preserve(AllMembers = true)] + public class Issue11333Model + { + public string Title { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue1146.cs b/src/Controls/tests/TestCases/Issues/Issue1146.cs new file mode 100644 index 000000000000..27805acbf3c7 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue1146.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 1146, "Disabled Switch in Button Gallery not rendering on all devices", PlatformAffected.Android)] + public class Issue1146 : TestContentPage + { + protected override void Init() + { + Content = new ScrollView + { + Content = new StackLayout + { + Padding = new Size(20, 20), + Children = { + new StackLayout { + Orientation = StackOrientation.Horizontal, + Children= { + new Switch() { IsEnabled = false , AutomationId="switch"}, + }, + }, + } + } + }; + } + } +} diff --git a/src/Controls/tests/TestCases/Issues/Issue11769.cs b/src/Controls/tests/TestCases/Issues/Issue11769.cs new file mode 100644 index 000000000000..1b546da8f972 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11769.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.CustomAttributes; +using Microsoft.Maui.Controls.Internals; + + +namespace Maui.Controls.Sample.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11769, "[Bug] Shell throws exception when delay adding Shell Content", issueTestNumber: 2)] + public class Issue11769_DelayedShellContent : TestShell + { + protected override void Init() + { + Items.Add(new FlyoutItem() + { + Items = + { + new Tab() + } + }); + + Device.InvokeOnMainThreadAsync(() => + { + var shellContent = new ShellContent() + { + Content = new ContentPage() + { + Content = new Label() { Text = "Success" } + } + }; + + Items[0].Items[0].Items.Add(shellContent); + }); + } + } + + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11769, "[Bug] Shell throws exception when delay adding Shell Section", issueTestNumber: 1)] + public class Issue11769_DelayedShellSection : TestShell + { + protected override void Init() + { + Items.Add(new FlyoutItem()); + Device.InvokeOnMainThreadAsync(() => + { + var tab = new Tab() + { + Items = + { + new ShellContent() + { + Content = new ContentPage() + { + Content = new Label() { Text = "Success" } + } + } + } + }; + + Items[0].Items.Add(tab); + }); + } + } + + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 11769, "[Bug] Shell throws exception when delay adding Shell Item", issueTestNumber: 0)] + public class Issue11769_DelayedShellItem : TestShell + { + protected override void Init() + { + Device.InvokeOnMainThreadAsync(() => + { + var page = AddBottomTab("Flyout Item"); + page.Content = new Label() + { + Text = "Success" + }; + }); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases/Issues/Issue11853.xaml b/src/Controls/tests/TestCases/Issues/Issue11853.xaml new file mode 100644 index 000000000000..42ab00d3f97c --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue11853.xaml @@ -0,0 +1,34 @@ + + + + + + + + + +