Add getPageId function and associated tests