/**
 * Check if the given string is in the URL path
 * @param  {String}   falseCase       Whether to check if the given string is in
 *                                    the URL path or not
 * @param  {String}   expectedUrlPart The string to check for
 */
import {CustomExpect} from "../../common-helpers/custom-expect";
import {browser, $, $$, expect} from '@wdio/globals'

export default async function (falseCase: boolean, expectedUrlPart: string) {
    /**
     * The URL of the current browser window
     * @type {String}
     */
    const currentUrl = await browser.getUrl();

    if (falseCase) {
        CustomExpect.expectNotToContain(currentUrl, expectedUrlPart, `Current URL "${currentUrl}" contains expected url path "${expectedUrlPart}"`)
    } else {
        CustomExpect.expectToContain(currentUrl, expectedUrlPart, `Current URL "${currentUrl}" does not contain expected url path "${expectedUrlPart}"`)
    }
};
