@@ -4,6 +4,7 @@ import { NavigationMenuPage } from '../model/recruiting/navigation-menu-page'
44import { CompaniesPage } from '../model/recruiting/companies-page'
55import { NewCompany } from '../model/recruiting/types'
66import { CompanyDetailsPage } from '../model/recruiting/company-details-page'
7+ import { DEFAULT_USER } from '../tracker/tracker.utils'
78
89test . use ( {
910 storageState : PlatformSetting
@@ -86,4 +87,36 @@ test.describe('Companies tests', () => {
8687 await navigationMenuPage . clickButtonCompanies ( )
8788 await companiesPage . checkCompanyNotExist ( deleteCompany . name )
8889 } )
90+
91+ test ( 'Filtering companies' , async ( { page } ) => {
92+ const firstCompany : NewCompany = {
93+ name : `Company for filtering one-${ generateId ( ) } `
94+ }
95+ const secondCompany : NewCompany = {
96+ name : `Company for filtering two-${ generateId ( ) } `
97+ }
98+ await test . step ( 'Create companies' , async ( ) => {
99+ await navigationMenuPage . clickButtonCompanies ( )
100+ await companiesPage . createNewCompany ( firstCompany )
101+ await companiesPage . checkCompanyExist ( firstCompany . name )
102+ await companiesPage . createNewCompany ( secondCompany )
103+ await companiesPage . checkCompanyExist ( secondCompany . name )
104+ } )
105+ await test . step ( 'Filtering by creator' , async ( ) => {
106+ await companiesPage . selectFilter ( 'Created by' , DEFAULT_USER )
107+ await companiesPage . pressEscape ( )
108+ await companiesPage . checkCompanyExist ( firstCompany . name )
109+ await companiesPage . checkCompanyExist ( secondCompany . name )
110+ } )
111+ await test . step ( 'Filtering by name' , async ( ) => {
112+ await companiesPage . selectFilter ( 'Name' , firstCompany . name , companiesPage . addFilterButton ( ) )
113+ await companiesPage . checkCompanyExist ( firstCompany . name )
114+ await companiesPage . checkCompanyNotExist ( secondCompany . name )
115+ } )
116+ await test . step ( 'Remove name filter' , async ( ) => {
117+ await companiesPage . removeFilterOption ( 'Name' )
118+ await companiesPage . checkCompanyExist ( firstCompany . name )
119+ await companiesPage . checkCompanyExist ( secondCompany . name )
120+ } )
121+ } )
89122} )
0 commit comments