Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix - 41115, 41116, 42099 - Playwright Accessibility And VRT Bug Fixes #3885

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ limitations under the License.
using GingerCore.Actions.VisualTesting;
using GingerCore.Drivers;
using GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Drawing;
Expand Down Expand Up @@ -395,7 +396,12 @@ public bool CheckSetAppWindowSize()
break;
case eChangeAppWindowSize.Custom:
mDriver.ChangeAppWindowSize(Convert.ToInt32(GetInputParamCalculatedValue(nameof(SetAppWindowWidth))), Convert.ToInt32(GetInputParamCalculatedValue(nameof(SetAppWindowHeight))));
Size size = mDriver.GetWebDriver().Manage().Window.Size;
IWebDriver webDriver = mDriver.GetWebDriver();
if (webDriver == null)
{
return true;
}
Size size = webDriver.Manage().Window.Size;
if (Convert.ToInt32(GetInputParamCalculatedValue(nameof(SetAppWindowWidth))) + 5 < size.Width)//+5 added to check with actual viewport/size of the browser which can be different by 2 0r 3 points
{
this.Error = string.Format("Unable to set custom width of web page to {0}, min supported width is {1}.", GetInputParamCalculatedValue(nameof(SetAppWindowWidth)), size.Width.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ private AxeRunOptions CreateAxeRunOptions()
List<string> sevritylist = _act.SeverityList.Select(x => x.Value.ToLower()).ToList();
string[] SeverityExcludeRules = RuleData.Where(x => !ExcludeRules.Contains(x.RuleID) && sevritylist.Contains(x.Impact.ToLower())).Select(i => i.RuleID.ToString()).ToArray();
ExcludeRules = ExcludeRules.Concat(SeverityExcludeRules).ToArray();
if (ExcludeRules != null && ExcludeRules.Any())
}
if (ExcludeRules != null && ExcludeRules.Any())
{
var rulesMap = new Dictionary<string, RuleOptions>();
foreach (var rule in ExcludeRules)
{
var rulesMap = new Dictionary<string, RuleOptions>();
foreach (var rule in ExcludeRules)
rulesMap[rule] = new RuleOptions
{
rulesMap[rule] = new RuleOptions
{
Enabled = false
};
}
axeRunOptions.Rules = rulesMap;
Enabled = false
};
}
axeRunOptions.Rules = rulesMap;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ public override void RunAction(Act act)
}
break;
case ActAccessibilityTesting actAccessibilityTesting:
if (!BrowserPrivateMode)
{
act.Error = $"Playwright Driver must be in Private mode for using Accessibility actions";
break;
}
ActAccessibilityTestingHandler actAccessibilityTestingHandler;
if (actAccessibilityTesting.GetAccessibilityTarget() == ActAccessibilityTesting.eTarget.Element)
{
Expand Down Expand Up @@ -257,7 +262,7 @@ public bool IsActionSupported(Act act, out string message)
{
message = string.Empty;

if (act is ActWithoutDriver or ActScreenShot)
if (act is ActWithoutDriver or ActScreenShot or ActGotoURL or ActAccessibilityTesting)
{
return true;
}
Expand Down Expand Up @@ -306,8 +311,12 @@ public bool IsActionSupported(Act act, out string message)
}
else if (act is ActVisualTesting actVisualTesting)
{
message = $"{actVisualTesting.VisualTestingAnalyzer} is not supported by Playwright driver, use Selenium driver instead.";
return actVisualTesting.VisualTestingAnalyzer != ActVisualTesting.eVisualTestingAnalyzer.Applitools;
if (actVisualTesting.VisualTestingAnalyzer == ActVisualTesting.eVisualTestingAnalyzer.Applitools)
{
message = $"{actVisualTesting.VisualTestingAnalyzer} is not supported by Playwright driver, use Selenium driver instead.";
return false;
}
return true;
}
else
{
Expand Down
Loading