1
00:00:00,780 --> 00:00:07,800
All right, so now that we know the theoretical aspects of the Foleo parameters and how we can actually

2
00:00:07,800 --> 00:00:13,200
work with the flow parameters and stuff, but now we're going to write the actual code and we'll see

3
00:00:13,200 --> 00:00:19,610
how we can create the Foleo parameters and how we can run the test using the Foleo parameters sonorant

4
00:00:19,620 --> 00:00:20,300
for doing that.

5
00:00:20,310 --> 00:00:26,100
I'm going to go back to the Foleo example that we wrote where we actually understood how we can create

6
00:00:26,100 --> 00:00:32,040
our own fixtures and this time we're going to create our own fixture once again, but with the parameter

7
00:00:32,040 --> 00:00:32,640
options.

8
00:00:32,640 --> 00:00:34,170
So I'm going to create a new file.

9
00:00:34,180 --> 00:00:39,990
I'm going to call this as a fixture, Parum Dot Ts.

10
00:00:40,440 --> 00:00:42,710
And over here I'm going to start writing the code.

11
00:00:43,050 --> 00:00:47,810
So again, we need to do this import that we always do.

12
00:00:48,180 --> 00:00:54,240
So I'm just going to do something like from and playwrite test.

13
00:00:54,630 --> 00:01:04,140
And then over here we need to get the folio as our base, which is something we did in our earlier video

14
00:01:04,140 --> 00:01:04,640
as well.

15
00:01:04,980 --> 00:01:12,750
And then we need to do an export of the expect something like this and then we need to declare the new

16
00:01:12,750 --> 00:01:17,040
fixture as a parameter like how we saw on the on the slide.

17
00:01:17,040 --> 00:01:19,550
So that card is going to look something like this.

18
00:01:19,560 --> 00:01:26,990
So I'm trying to do is I'm just going to do a base of extend where I'm going to be creating two parameters.

19
00:01:27,000 --> 00:01:29,520
One is for the browser and another one is for the vision.

20
00:01:29,790 --> 00:01:35,030
And then I'm just going to use these parameter value to be parsed during the command line.

21
00:01:35,310 --> 00:01:38,550
And I also need to set the default value.

22
00:01:38,550 --> 00:01:45,360
For some reason, if we just run the folio of the Inpex folio and the test name, then it is going to

23
00:01:46,500 --> 00:01:51,600
run this particular default description and value for me.

24
00:01:51,660 --> 00:01:57,270
So this is something like every time you run the test, you're going to always choose the browser version

25
00:01:57,390 --> 00:01:58,320
as Eighty-six.

26
00:01:58,920 --> 00:02:03,780
If you don't specify that in the parameter, if you do specify the browser version on the parameter,

27
00:02:03,780 --> 00:02:07,100
then it is going to use that particular version for you.

28
00:02:07,440 --> 00:02:15,780
And once again, as I told you, in order for a running the the browser, we are going to actually perform

29
00:02:15,780 --> 00:02:19,350
the init operation of the fixture, something like this.

30
00:02:19,590 --> 00:02:25,810
And as you can see over here for the first time, we are actually using a scope of worker.

31
00:02:26,190 --> 00:02:30,990
And this particular code, as we saw on the slide, is just an efficient condition where if the version

32
00:02:30,990 --> 00:02:36,300
that I'm trying to pass in from the parameter is going to be like greater than add than just print like

33
00:02:36,300 --> 00:02:36,600
that.

34
00:02:37,100 --> 00:02:40,620
If it is smaller than 80, then it's going to be this one.

35
00:02:40,860 --> 00:02:41,240
Yeah.

36
00:02:41,250 --> 00:02:42,810
So this is how it is going to be.

37
00:02:42,810 --> 00:02:48,000
It's designed to run for that particular browser on this fixture.

38
00:02:48,720 --> 00:02:49,020
That's it.

39
00:02:49,050 --> 00:02:51,180
So this is the only change that we need to do.

40
00:02:51,180 --> 00:02:53,880
And the rest of the code is going to be pretty much like this.

41
00:02:53,880 --> 00:02:59,760
I mean, we need to export the ID of the folio so that we can access it from the test that we are going

42
00:02:59,760 --> 00:03:00,390
to be executing.

43
00:03:00,720 --> 00:03:06,930
So once we do that, we can now try to execute this code using this particular fixer.

44
00:03:06,930 --> 00:03:10,030
Param starts and we'll see how it actually works.

45
00:03:10,050 --> 00:03:11,870
So this is very, very simple.

46
00:03:12,060 --> 00:03:17,490
All we're trying to do is we are going to use this init parameter this time, which is going to be useful

47
00:03:17,490 --> 00:03:19,990
for us to perform the operation that we are looking for.

48
00:03:20,790 --> 00:03:25,650
So now that I'm going to use another test, probably because we are going to be working on the work

49
00:03:25,650 --> 00:03:33,930
or we are going to call this houseworker dart spec darts where I'm actually going to be calling this

50
00:03:33,930 --> 00:03:37,890
particular fixer upper arm and we'll see how it actually works for that.

51
00:03:37,900 --> 00:03:48,750
I'm just going to go to the import of from dot slash, fix it from and we are going to be importing

52
00:03:48,750 --> 00:03:49,500
the it.

53
00:03:49,740 --> 00:03:55,890
So I'm just going to call it over here and I'm just going to write the test method using the it.

54
00:03:55,920 --> 00:03:57,930
So I'm just going to say it.

55
00:03:58,290 --> 00:03:59,940
Let's a browser

56
00:04:02,700 --> 00:04:09,530
version test and here I'm just going to call the async like how we used to do that.

57
00:04:09,780 --> 00:04:14,820
I'm going to pass the let's say I'm going to pass the browser probably.

58
00:04:17,790 --> 00:04:23,630
And once it is done, then we can actually try to run the test and see how it actually works.

59
00:04:23,670 --> 00:04:29,620
I'm just going to do a console dart log of probably the browser that I'm just trying to pass in that

60
00:04:29,620 --> 00:04:30,890
says so this is a super simple test.

61
00:04:30,900 --> 00:04:35,460
I just want to make a point here that how we can actually run the test from the command line and how

62
00:04:35,460 --> 00:04:37,260
we can execute it using the parameter.

63
00:04:37,590 --> 00:04:45,200
So far doing that, I'm just going to go to to the Khedive

64
00:04:47,910 --> 00:04:54,210
Foleo example and we're going to do NPCs Foleo of.

65
00:04:55,840 --> 00:04:57,640
Workers, spectators file.

66
00:04:57,700 --> 00:05:03,970
So now if I try to run without passing any parameter, and as I told you before, if you don't pass

67
00:05:03,970 --> 00:05:10,320
any parameter, then it is just going to invoke this particular in problem for us.

68
00:05:10,330 --> 00:05:13,390
So let's try to execute this and see what actually happens.

69
00:05:14,020 --> 00:05:15,400
So we get an error here.

70
00:05:15,400 --> 00:05:19,240
And it says that the browser has already been registered.

71
00:05:19,240 --> 00:05:22,440
Use the override to override doing a specific test file.

72
00:05:22,690 --> 00:05:28,870
And because we know that if we use something like a browser, this browser is actually available in

73
00:05:28,870 --> 00:05:32,030
our playwrite parameter, as you can see over here.

74
00:05:32,050 --> 00:05:38,440
So if I just click this, do you see that the index drops file over here where it shows that playwrite

75
00:05:38,650 --> 00:05:42,240
worker fixture where it actually has something called as browsers?

76
00:05:42,240 --> 00:05:48,340
So basically browser in the sense over here, it's because it tells you that the browser is actually

77
00:05:48,340 --> 00:05:48,840
available.

78
00:05:49,090 --> 00:05:53,890
So in order to resolve this problem, there are two way we can actually do this to resolve this problem,

79
00:05:54,550 --> 00:05:55,510
to fix this issue.

80
00:05:55,520 --> 00:06:04,120
Basically, one is we can directly use something called S Foleo over here to try to run this particular

81
00:06:04,120 --> 00:06:07,240
test without using the playwrights test.

82
00:06:07,510 --> 00:06:10,210
We can directly get the directive from the Foleo.

83
00:06:10,210 --> 00:06:15,580
And then if you try to run this particular test, it is going to work as expected as you can see over

84
00:06:15,580 --> 00:06:15,940
here.

85
00:06:16,180 --> 00:06:24,070
Or we can also do something like a changing of this particular name from browser to browsers, something

86
00:06:24,070 --> 00:06:24,340
like that.

87
00:06:24,480 --> 00:06:28,510
I mean, this is not something registered or maybe like browser.

88
00:06:29,350 --> 00:06:34,870
Yeah, browsers should be fine because I don't think it has been registered somewhere and this is pretty

89
00:06:34,870 --> 00:06:35,160
good.

90
00:06:35,470 --> 00:06:40,480
And now if I go back to my test, let's change this to browsers like that.

91
00:06:43,420 --> 00:06:44,020
Say it.

92
00:06:44,020 --> 00:06:47,440
And now if I tried to run this test, hopefully it is not registered anywhere.

93
00:06:47,710 --> 00:06:50,260
And you can see that this test is also working fine.

94
00:06:51,430 --> 00:06:56,050
But again, for some reason, it is actually calling the Firefox.

95
00:06:56,950 --> 00:07:01,660
And I think this browser is also registered somewhere on the on the worker's back.

96
00:07:01,840 --> 00:07:06,290
And for some reason, I could see that it is actually calling the real browsers in here.

97
00:07:06,340 --> 00:07:08,800
So this is also not the right way of doing it.

98
00:07:09,010 --> 00:07:15,520
So better that you just use a different naming convention for the browser, because the browser is I

99
00:07:15,520 --> 00:07:20,650
think it is also registered in the playwright to work with the different browsers.

100
00:07:20,770 --> 00:07:26,710
So instead of using this, if you just tried to use something like Abreau or something like that, like

101
00:07:26,740 --> 00:07:35,790
this is the name which I don't think is available anywhere on the register code of the playwright.

102
00:07:36,010 --> 00:07:37,690
So if I tried to exclude this.

103
00:07:40,240 --> 00:07:45,160
Oops, I'm getting an error because I think it is not being saved, as you can see here, there is a

104
00:07:45,160 --> 00:07:48,880
dark there, which means it is not saved to save the file.

105
00:07:49,210 --> 00:07:53,100
And if I tried to execute this, now you can see that it is working as expected.

106
00:07:53,110 --> 00:07:58,270
So basically, it should not be browser or browsers or something like that because it's been used by

107
00:07:58,270 --> 00:08:01,720
playwrite somewhere in their internal services.

108
00:08:01,720 --> 00:08:03,570
So I cannot just mess up with that.

109
00:08:03,590 --> 00:08:07,210
It's already been registered with playwrite, so let's not use that though.

110
00:08:07,450 --> 00:08:09,280
So but so you got the idea, right?

111
00:08:09,280 --> 00:08:15,010
I mean, you can pause this and you get this particular vergence, like running the latest version of

112
00:08:15,010 --> 00:08:22,990
the browser and use the new driver because it is automatically taking the version number 86 and then

113
00:08:23,140 --> 00:08:23,890
the current version.

114
00:08:23,890 --> 00:08:26,140
And so us eighty-six and then it is parsing.

115
00:08:26,560 --> 00:08:30,700
And that is the reason you can see that this particular test is actually working fine without any problem.

116
00:08:30,940 --> 00:08:36,400
But now there is another cache that you can do instead of the browser in here, let's say if I want

117
00:08:36,400 --> 00:08:37,720
to get this particular version.

118
00:08:37,720 --> 00:08:42,550
So I just want to print the version and I want to run this test this time.

119
00:08:42,760 --> 00:08:48,070
So if we call this version, this is going to initialize this particular parameter alone.

120
00:08:48,340 --> 00:08:52,460
So whatever parameter that you're going to pass in is going to be executed for you.

121
00:08:52,480 --> 00:08:56,860
So if I tried to execute this test, you can see that the printing value changes this time.

122
00:08:56,890 --> 00:09:01,570
So instead of this running latest version of browser use, new driver current version is eighty six.

123
00:09:01,760 --> 00:09:05,140
It is just printing the values 86, which is nothing but this one.

124
00:09:05,260 --> 00:09:08,680
So only this particular init parameter is being called.

125
00:09:08,860 --> 00:09:17,870
You can also see this using the parameter that we can pass from Parum hyphen P version is equal to eighty

126
00:09:17,920 --> 00:09:19,030
nine or something like that.

127
00:09:19,040 --> 00:09:24,820
If I tried to run this, you can see that it only overrides the value, the default value from eighty

128
00:09:24,820 --> 00:09:28,680
six to eighty nine and then it prints that particular value.

129
00:09:29,260 --> 00:09:35,290
But because the reason is our test is actually using the version as the parameter over here, that's

130
00:09:35,380 --> 00:09:39,700
what it is using from the fixed parameter to initialize as well.

131
00:09:39,820 --> 00:09:44,560
And that's exactly what we discussed even in the fixture while we were discussing over here with the

132
00:09:44,560 --> 00:09:45,570
different prototypes.

133
00:09:46,030 --> 00:09:52,090
So this time, instead of the version, let's say, if I want to use the pro, I think it's pretty bad

134
00:09:52,090 --> 00:09:55,840
name, though, for the programming constructor at least.

135
00:09:56,110 --> 00:10:02,200
And now if I just put Bre over here and if I tried to run the version of eighty 89, something like

136
00:10:02,200 --> 00:10:08,890
that, you can see that it tells running one test, using one worker for this particular version, number

137
00:10:08,890 --> 00:10:09,630
89.

138
00:10:10,000 --> 00:10:12,280
And now let's make another trick.

139
00:10:12,280 --> 00:10:14,960
So that's what is the power of this particular parameter.

140
00:10:14,970 --> 00:10:22,870
It's like if we want to use two different version, let's say 89 and it's a forty which is a lawyer

141
00:10:22,870 --> 00:10:23,380
version.

142
00:10:23,590 --> 00:10:25,420
So you should be getting a different message.

143
00:10:25,690 --> 00:10:31,750
So if I run this time, you will see that there'll be two test running using two workers so it automatically

144
00:10:31,750 --> 00:10:34,090
respond to working for us.

145
00:10:34,360 --> 00:10:39,340
And then it says that running all the original browser and users, the older driver, the current version

146
00:10:39,340 --> 00:10:45,310
is 40, whereas it says the running latest version of browser use new driver current version is eighty

147
00:10:45,310 --> 00:10:45,560
nine.

148
00:10:45,580 --> 00:10:50,650
So that I'd like to print a happened here for two workers test been executed.

149
00:10:50,890 --> 00:10:52,470
So that's what I was talking about.

150
00:10:52,480 --> 00:11:00,250
We now have the ability to control the test based on the configuration that we can specify on our test

151
00:11:00,400 --> 00:11:04,660
and we can posit from the parameter using the Foleo parameters.

152
00:11:04,990 --> 00:11:07,170
So guys, this is about the FOLIA parameter.

153
00:11:07,540 --> 00:11:10,960
Let's meet in our next video to talk about the skip test.
