Exemplo n.º 1
0
 public void WhenISelectTheVectorsButton(int vector)
 {
     SeleniumPage.Should().BeFound()
     .Then().RadioButton(vector)
     .Should().BeFound()
     .Then().Click();
 }
Exemplo n.º 2
0
        public void ThenTheVectorShouldBeDisplayed(int vector)
        {
            SeleniumPage.Should().BeFound()
            .Then().VectorTable(vector)
            .Should().BeFound();

            var vectorRows = vector switch
            {
                3 => new ThirdVector().VectorRows,
                4 => new FourthVector().VectorRows,
                5 => new FifthVector().VectorRows,
                _ => throw new ArgumentOutOfRangeException(nameof(vector), vector,
                                                           $"{vector} is not a known value")
            };

            if (vectorRows == null)
            {
                return;
            }
            foreach (var vectorRow in vectorRows)
            {
                var vectorBarGraph = SeleniumPage.VectorTable(vector)
                                     .Should().BeFound().Then()
                                     .VectorBarGraphs.SingleOrDefault(x => x.Title.Text == vectorRow.Title);

                vectorBarGraph.Should().NotBeNull();
                vectorBarGraph.Should().BeFound();

                Debug.Assert(vectorBarGraph != null, nameof(vectorBarGraph) + " != null");
                var tuples = new List <(SeleniumElement, string, int?)>
                {
                    (vectorBarGraph.Row627, "6-27", vectorRow.DistanceOf627),
                    (vectorBarGraph.Row630, "6-30", vectorRow.DistanceOf630),
                    (vectorBarGraph.Row6Z13, "6Z13", vectorRow.DistanceOf6Z13),
                    (vectorBarGraph.Row6Z23, "6Z23", vectorRow.DistanceOf6Z23),
                    (vectorBarGraph.Row6Z49, "6Z49", vectorRow.DistanceOf6Z49),
                    (vectorBarGraph.Row6Z50, "6Z50", vectorRow.DistanceOf6Z50)
                };

                foreach (var tuple in tuples)
                {
                    var(row, expectedText, expectedDistance) = tuple;
                    if (!expectedDistance.HasValue || expectedDistance <= 0)
                    {
                        continue;
                    }

                    row.Text.Should().BeEquivalentTo(expectedText);
                    row.GetAttribute("style")
                    .Should().Contain($"width: {expectedDistance * 25}%");
                }

                vectorBarGraph.DistanceKeys.Rows.Single()
                .Columns.Select(x => x.Text)
                .Should().BeEquivalentTo(Enumerable.Range(0, 5)
                                         .Select(x => x.ToString(CultureInfo.InvariantCulture)));
            }
        }
    }
Exemplo n.º 3
0
 public void ThenTheIntervalOrderTextShouldBeDisplayed(string intervalOrder)
 {
     SeleniumPage.Should().WaitFor(x => x.DisplayRows.Any()).Then()
     .DisplayRows.Should().AllBeFound()
     .And.ContainText(intervalOrder?.ToUpperInvariant() switch
     {
         "6-27" => new IntervalOrder627().DisplayRows,
         "6-30" => new IntervalOrder630().DisplayRows,
         "6Z13" => new IntervalOrder6Z13().DisplayRows,
         "6Z23" => new IntervalOrder6Z23().DisplayRows,
         "6Z28" => new IntervalOrder6Z28().DisplayRows,
         "6Z29" => new IntervalOrder6Z29().DisplayRows,
         "6Z42" => new IntervalOrder6Z42().DisplayRows,
         "6Z45" => new IntervalOrder6Z45().DisplayRows,
         "6Z49" => new IntervalOrder6Z49().DisplayRows,
         "6Z50" => new IntervalOrder6Z50().DisplayRows,
         _ => throw new ArgumentOutOfRangeException(nameof(intervalOrder), intervalOrder,
                                                    $"{intervalOrder} is not a known value")
     });