Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
prashelke committed Aug 6, 2024
1 parent 3cea8eb commit d53461e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public AccessibilityRulePage()
InitializeComponent();
mSolution = WorkSpace.Instance.Solution;
string allProperties = string.Empty;
actAccessibilityTesting = new ActAccessibilityTesting();
LoadGridData();
SetAppsGrid();
mAccessibilityConfiguration = !WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<AccessibilityConfiguration>().Any() ? new AccessibilityConfiguration() : WorkSpace.Instance.SolutionRepository.GetFirstRepositoryItem<AccessibilityConfiguration>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public ObservableList<AccessibilityRuleData> RulesItemsdata
public ObservableList<AccessibilityRuleData> GetRuleList()
{
AccessibilityRuleData AccessibilityRuleDataObjet = new AccessibilityRuleData();
AccessibilityConfiguration mAccessibilityConfiguration = new ();
AccessibilityConfiguration mAccessibilityConfiguration;
if (WorkSpace.Instance.SolutionRepository != null)
{
if(!WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<AccessibilityConfiguration>().Any())
Expand All @@ -323,7 +323,7 @@ public ObservableList<AccessibilityRuleData> GetRuleList()
mAccessibilityConfiguration = new ();
}
mAccessibilityConfiguration.ExcludedRules = mAccessibilityConfiguration.ExcludedRules != null ? mAccessibilityConfiguration.ExcludedRules : new();
ObservableList<AccessibilityRuleData> ruleDatalist = new ();
ObservableList<AccessibilityRuleData> ruleDatalist;
try
{
string AccessbiltyString = GetAccessiblityrules();
Expand All @@ -339,13 +339,14 @@ public ObservableList<AccessibilityRuleData> GetRuleList()
ruleData.Active = true;
}
}
return ruleDatalist;
}
catch (Exception ex)
{
Error = "Error: during accessibility testing:" + ex.Message;
Reporter.ToLog(eLogLevel.ERROR, $"Error: during accessibility testing in GetRuleList. Configuration: {mAccessibilityConfiguration?.Name}", ex);
}
return ruleDatalist;
return [];
}

private Dictionary<string, object> _items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class AccessiblityTests
{

private static IWebDriver _driver;
ActAccessibilityTesting mact;
IWebElement e = null;

[ClassInitialize()]
Expand Down Expand Up @@ -82,7 +81,7 @@ public void TestAnalyzerAccessibility_Standard_Failed()
return;
}
_driver.Navigate().GoToUrl($"https://ginger.amdocs.com/");
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Target, ActAccessibilityTesting.eTarget.Page);
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Analyzer, ActAccessibilityTesting.eAnalyzer.ByStandard);
if (mact.GetInputParamValue(ActAccessibilityTesting.Fields.Analyzer) == nameof(ActAccessibilityTesting.eAnalyzer.ByStandard))
Expand All @@ -103,7 +102,7 @@ public void TestAnalyzerAccessibility_Severity_Failed()
return;
}
_driver.Navigate().GoToUrl($"https://ginger.amdocs.com/");
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Target, ActAccessibilityTesting.eTarget.Page);
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Analyzer, ActAccessibilityTesting.eAnalyzer.BySeverity);
if (mact.GetInputParamValue(ActAccessibilityTesting.Fields.Analyzer) == nameof(ActAccessibilityTesting.eAnalyzer.BySeverity))
Expand All @@ -124,7 +123,7 @@ public void TestAnalyzerAccessibility_Standard_Pass()
}
string htmlFilePath = Path.Combine(TestResources.GetTestResourcesFolder("Html"), "TestAccessiblity.html");
_driver.Navigate().GoToUrl(htmlFilePath);
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Target, ActAccessibilityTesting.eTarget.Page);
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Analyzer, ActAccessibilityTesting.eAnalyzer.ByStandard);
if (mact.GetInputParamValue(ActAccessibilityTesting.Fields.Analyzer) == nameof(ActAccessibilityTesting.eAnalyzer.ByStandard))
Expand All @@ -145,7 +144,7 @@ public void TestAnalyzerAccessibility_Severity_Pass()
}
string htmlFilePath = Path.Combine(TestResources.GetTestResourcesFolder("Html"), "TestAccessiblity.html");
_driver.Navigate().GoToUrl(htmlFilePath);
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Target, ActAccessibilityTesting.eTarget.Page);
mact.GetOrCreateInputParam(ActAccessibilityTesting.Fields.Analyzer, ActAccessibilityTesting.eAnalyzer.BySeverity);
if (mact.GetInputParamValue(ActAccessibilityTesting.Fields.Analyzer) == nameof(ActAccessibilityTesting.eAnalyzer.BySeverity))
Expand All @@ -164,7 +163,7 @@ public void TestCreateAxeBuilder_IsNotNull()
{
return;
}
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
AxeBuilder axeBuilder = mact.CreateAxeBuilder(_driver);
Assert.AreNotEqual(null, axeBuilder);
}
Expand All @@ -176,7 +175,7 @@ public void TestGetRuleList_isNotNull()
{
return;
}
mact = new ActAccessibilityTesting();
ActAccessibilityTesting mact = new ActAccessibilityTesting();
ObservableList<AccessibilityRuleData> ruleList = mact.GetRuleList();
Assert.AreNotEqual(null, ruleList);
Assert.AreEqual(92, ruleList.Count);
Expand Down

0 comments on commit d53461e

Please sign in to comment.